From: Amos Jeffries Date: Tue, 2 Feb 2010 09:04:12 +0000 (+1300) Subject: Handle DNS header-only packets as invalid. X-Git-Tag: SQUID_3_0_STABLE23~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4ad3f06311e55a57081ca39d2a1dc2b3b317b76;p=thirdparty%2Fsquid.git Handle DNS header-only packets as invalid. --- diff --git a/lib/rfc1035.c b/lib/rfc1035.c index 77a4d6ddfe..b9779cbe88 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -287,7 +287,10 @@ rfc1035NameUnpack(const char *buf, size_t sz, unsigned int *off, unsigned short size_t len; assert(ns > 0); do { - assert((*off) < sz); + if ((*off) >= sz) { + RFC1035_UNPACK_DEBUG; + return 1; + } c = *(buf + (*off)); if (c > 191) { /* blasted compression */