From: Amos Jeffries Date: Thu, 19 Feb 2009 02:14:00 +0000 (+1300) Subject: Bug 2588: coredump in rDNS lookup X-Git-Tag: SQUID_3_0_STABLE14~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0574dd7186d3d77a6a5f470e2792ad7c994845b1;p=thirdparty%2Fsquid.git Bug 2588: coredump in rDNS lookup Handle rDNS of invalid IP gracefully. --- diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 0549fd074e..739f452762 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -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);