]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Handle DNS header-only packets as invalid.
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 16 Jan 2010 03:51:51 +0000 (16:51 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 16 Jan 2010 03:51:51 +0000 (16:51 +1300)
lib/rfc1035.c

index 77a4d6ddfecde4d8914b17c8b08c29d8a90f69cc..0552e5cd308d7e2f30f8731999e43236560e52d8 100644 (file)
@@ -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 */