From: serassio <> Date: Sun, 23 Jan 2005 21:53:23 +0000 (+0000) Subject: Backed out previos patch: wrong patch description X-Git-Tag: SQUID_3_0_PRE4~896 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6fc55a63c084b8b6f641cf88a6c08ad1f8b7aff0;p=thirdparty%2Fsquid.git Backed out previos patch: wrong patch description --- diff --git a/lib/rfc1035.c b/lib/rfc1035.c index c07ddf654f..f0c9417cad 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -1,6 +1,6 @@ /* - * $Id: rfc1035.c,v 1.32 2005/01/23 12:39:45 serassio Exp $ + * $Id: rfc1035.c,v 1.33 2005/01/23 14:53:23 serassio Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels @@ -554,10 +554,11 @@ rfc1035AnswersUnpack(const char *buf, return -rfc1035_unpack_error; } } - if (hdr.ancount == 0) + i = (int) hdr.ancount; + if (i == 0) return 0; - recs = calloc((int)hdr.ancount, sizeof(*recs)); - for (i = 0; i < (int)hdr.ancount; i++) { + recs = calloc(i, sizeof(*recs)); + while (i--) { if (off >= sz) { /* corrupt packet */ RFC1035_UNPACK_DEBUG; break;