Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match() skips over initial null bytes in strings if mask starts with * #22

Closed
retropc opened this issue Jan 30, 2016 · 2 comments
Closed
Labels

Comments

@retropc
Copy link
Member

retropc commented Jan 30, 2016

to fix: replace match with that from ircd

@retropc retropc added the bug label Jan 30, 2016
@retropc
Copy link
Member Author

retropc commented Jan 30, 2016

Breakpoint 4, match (mask=0x687c22 "*@CPE-121-218-163-123.lnse4.cht.bigpond.net.au", string=0x69ce72 "") at irc_string.c:483
note string is empty
483 const char *m = mask, *s = string;
at the end of the function:
(gdb) print s
$21 = 0x69ce76 ""

it's gone and dereferenced it 3 times over the end of the buffer

@retropc
Copy link
Member Author

retropc commented Jan 30, 2016

#include "bans.h"
int main(void) {
  chanban *a = makeban("*!Zero*!*@*");
  chanban *b = makeban("*!Zero@*");
  banoverlap(a, b);
}

also triggers it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant