]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Handle very large DNS responses gracefully.
authorhno <>
Mon, 21 Aug 2006 03:02:53 +0000 (03:02 +0000)
committerhno <>
Mon, 21 Aug 2006 03:02:53 +0000 (03:02 +0000)
src/ipcache.cc

index 165da8d183047e5006e84d2773bc6628da3aa5ee..f337033939c354e2ef9a93bf37accba0f694d6d3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.256 2006/08/07 02:28:22 robertc Exp $
+ * $Id: ipcache.cc,v 1.257 2006/08/20 21:02:53 hno Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -446,7 +446,10 @@ ipcacheParse(ipcache_entry *i, rfc1035_rr * answers, int nr, const char *error_m
 
     assert(j == na);
 
-    i->addrs.count = (unsigned char) na;
+    if (na < 256)
+        i->addrs.count = (unsigned char) na;
+    else
+        i->addrs.count = 255;
 
     if (ttl == 0 || ttl > Config.positiveDnsTtl)
         ttl = Config.positiveDnsTtl;