From f9409b10fd3569a3b65ff1bbcc35a11e2f256bdd Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 22 Jan 2002 04:15:45 +0000 Subject: [PATCH] pullup: 1152. [bug] libbind: read buffer overflows. --- CHANGES | 2 ++ lib/bind/irs/dns_nw.c | 8 ++------ lib/bind/irs/getaddrinfo.c | 6 +----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 229f34969e..9c0a3b33e1 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,8 @@ 1154. [bug] Don't attempt to obtain the netmask of a interface if there is no address configured. [RT #2176] +1152. [bug] libbind: read buffer overflows. + 1144. [bug] rndc-confgen would crash if both the -a and -t options were specified. [RT #2159] diff --git a/lib/bind/irs/dns_nw.c b/lib/bind/irs/dns_nw.c index ab93ff5be6..43a404edd9 100644 --- a/lib/bind/irs/dns_nw.c +++ b/lib/bind/irs/dns_nw.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: dns_nw.c,v 1.3 2001/04/03 06:42:21 marka Exp $"; +static const char rcsid[] = "$Id: dns_nw.c,v 1.3.2.1 2002/01/22 04:15:44 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /* Imports. */ @@ -56,11 +56,7 @@ static const char rcsid[] = "$Id: dns_nw.c,v 1.3 2001/04/03 06:42:21 marka Exp $ #define MAXALIASES 35 -#if PACKETSZ > 1024 -#define MAXPACKET PACKETSZ -#else -#define MAXPACKET 1024 -#endif +#define MAXPACKET (64*1024) struct pvt { struct nwent net; diff --git a/lib/bind/irs/getaddrinfo.c b/lib/bind/irs/getaddrinfo.c index ba91e832b5..f2c533d611 100644 --- a/lib/bind/irs/getaddrinfo.c +++ b/lib/bind/irs/getaddrinfo.c @@ -172,11 +172,7 @@ static const struct explore explore[] = { #define PTON_MAX 16 -#if PACKETSZ > 1024 -#define MAXPACKET PACKETSZ -#else -#define MAXPACKET 1024 -#endif +#define MAXPACKET (1024*64) typedef union { HEADER hdr;