diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-05-11 14:01:43 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-05-11 14:01:43 +0000 |
commit | 3ec0d26c76d6905501034692d05bddbabae64e76 (patch) | |
tree | 191efcdfd934a0369cdef723fe4f650fe2f3dcfc /resolv/res_query.c | |
parent | 262cf6b3df91d5bb7cbdcae2390333b21e8008d5 (diff) |
Updated to fedora-glibc-20060511T1325cvs/fedora-glibc-2_4_90-7
Diffstat (limited to 'resolv/res_query.c')
-rw-r--r-- | resolv/res_query.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/resolv/res_query.c b/resolv/res_query.c index 0feba6687a..85bad97d2d 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -69,6 +69,7 @@ static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; static const char rcsid[] = "$BINDId: res_query.c,v 8.20 2000/02/29 05:39:12 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <sys/types.h> #include <sys/param.h> #include <netinet/in.h> @@ -151,6 +152,7 @@ __libc_res_nquery(res_state statp, free (buf); return (n); } + assert (answerp == NULL || (void *) *answerp == (void *) answer); n = __libc_res_nsend(statp, buf, n, answer, anslen, answerp); if (use_malloc) free (buf); @@ -163,6 +165,10 @@ __libc_res_nquery(res_state statp, return (n); } + if (answerp != NULL) + /* __libc_res_nsend might have reallocated the buffer. */ + hp = (HEADER *) *answerp; + if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { #ifdef DEBUG if (statp->options & RES_DEBUG) |