]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Potential fix for Bugzilla #236
authorhno <>
Sat, 13 Oct 2001 00:20:23 +0000 (00:20 +0000)
committerhno <>
Sat, 13 Oct 2001 00:20:23 +0000 (00:20 +0000)
Reading the code shows that if the reply contains a single truncated entry
then rfc1035AnswersUnpack will return 0 records, possibly causing assertion
failure in rfc1035RRDestroy

lib/rfc1035.c

index f74b6ecb247efcc94392f0119e81327aa6d11e6d..29a77082285a641508c88b7f779a301b66e4f904 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: rfc1035.c,v 1.21 2001/02/07 18:56:50 hno Exp $
+ * $Id: rfc1035.c,v 1.22 2001/10/12 18:20:23 hno Exp $
  *
  * Low level DNS protocol routines
  * AUTHOR: Duane Wessels
@@ -464,7 +464,10 @@ rfc1035AnswersUnpack(const char *buf,
            break;
        nr++;
     }
-    *records = recs;
+    if (nr > 0)
+       *records = recs;
+    else
+       free(recs);
     return nr;
 }