X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fidnlookup.c;h=0fd367fb37482ef206dba81c82be44fd6ecbd3a1;hb=9533e44b92c3e098e640d1dabd44b3c58741dea1;hp=1727c4dedc20c26e0b00114961bdbb22d434f49d;hpb=25415ec8842de4109b23467aa1cd63e06bf19fbe;p=icmp-dn.git diff --git a/src/idnlookup.c b/src/idnlookup.c index 1727c4d..0fd367f 100644 --- a/src/idnlookup.c +++ b/src/idnlookup.c @@ -78,6 +78,10 @@ void printdn(FILE *f, unsigned char *dnbuf, size_t size, int onlyfirst) fprintf(stderr, "domain name decompression not implemented, aborting\n"); exit(1); } + if((int)*p + (p - dnbuf) >= size) { + fprintf(stderr, "malformed domain name\n"); + return; + } fprintf(f, "%.*s", (int)*p, p + 1); p += 1 + (int)*p; if(*p != 0) @@ -279,6 +283,6 @@ int main(int argc, char **argv) /* * Local Variables: - * compile-command: "gcc -Wall -g -o idnlookup idnlookup.c" + * compile-command: "make CFLAGS='-Wall -g'" * End: */