]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2588: coredump in rDNS lookup
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 19 Feb 2009 02:14:00 +0000 (15:14 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 19 Feb 2009 02:14:00 +0000 (15:14 +1300)
Handle rDNS of invalid IP gracefully.

src/fqdncache.cc

index 0549fd074e9fec16977be8720e137bd589312617..739f4527621a0a24aa59868048c77842e84c7918 100644 (file)
@@ -548,9 +548,12 @@ fqdncache_gethostbyaddr(struct IN_ADDR addr, int flags)
 {
     char *name = inet_ntoa(addr);
     fqdncache_entry *f = NULL;
+    struct in_addr ip;
+
+    if(!name) {
+        return NULL;
+    }
 
-    struct IN_ADDR ip;
-    assert(name);
     FqdncacheStats.requests++;
     f = fqdncache_get(name);