This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PINE-CERT libbind issue


Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE> writes:

|> Is someone already checking if this affects the code in libc/resolv?

The following patch is needed in libnss_dns:

2002-07-02  Andreas Schwab  <schwab@suse.de>

	* resolv/nss_dns/dns-network.c (getanswer_r): Reduce linebuflen
	in parallel to bumping up the buffer pointer.

--- resolv/nss_dns/dns-network.c.~1.10.~	2001-07-16 10:43:47.000000000 +0200
+++ resolv/nss_dns/dns-network.c	2002-06-27 13:35:41.000000000 +0200
@@ -328,7 +328,9 @@ getanswer_r (const querybuf *answer, int
 	    }
 	  cp += n;
 	  *alias_pointer++ = bp;
-	  bp += strlen (bp) + 1;
+	  n = strlen (bp) + 1;
+	  bp += n;
+	  linebuflen -= n;
 	  result->n_addrtype = class == C_IN ? AF_INET : AF_UNSPEC;
 	  ++have_answer;
 	}

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]