From: Amos Jeffries Date: Sat, 16 Jan 2010 03:51:51 +0000 (+1300) Subject: Handle DNS header-only packets as invalid. X-Git-Tag: SQUID_3_0_STABLE22~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0271ca1bc031d1d5dcb8325460fbbbe62b358ab;p=thirdparty%2Fsquid.git Handle DNS header-only packets as invalid. --- diff --git a/lib/rfc1035.c b/lib/rfc1035.c index 77a4d6ddfe..0552e5cd30 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -288,6 +288,10 @@ rfc1035NameUnpack(const char *buf, size_t sz, unsigned int *off, unsigned short assert(ns > 0); do { assert((*off) < sz); + if ((*off) >= sz) { + RFC1035_UNPACK_DEBUG; + return 1; + } c = *(buf + (*off)); if (c > 191) { /* blasted compression */