summaryrefslogtreecommitdiff
path: root/resolv/res_query.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-05-20 19:31:24 +0000
committerJakub Jelinek <jakub@redhat.com>2008-05-20 19:31:24 +0000
commite96fe50f0dd8d76fabfe139b46f059e3b2373b83 (patch)
tree50833fb9c0c5028eb88000d9dc7aa0e0b56b1747 /resolv/res_query.c
parent21032d9230e840a1f8b89d43e1e8d63ccf7c6eae (diff)
Updated to fedora-glibc-20080520T1924cvs/fedora-glibc-2_8_90-4
Diffstat (limited to 'resolv/res_query.c')
-rw-r--r--resolv/res_query.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/resolv/res_query.c b/resolv/res_query.c
index a8e8d7b739..3d2f2fe3a9 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -224,6 +224,21 @@ __libc_res_nquery(res_state statp,
tests of HP2. */
HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
+ if (n < sizeof (HEADER) && nanswerp2 != NULL
+ && *nanswerp2 > sizeof (HEADER))
+ {
+ /* Special case of partial answer. */
+ assert (hp != hp2);
+ hp = hp2;
+ }
+ else if (nanswerp2 != NULL
+ && *nanswerp2 < sizeof (HEADER) && n > sizeof (HEADER))
+ {
+ /* Special case of partial answer. */
+ assert (hp != hp2);
+ hp2 = hp;
+ }
+
if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
&& (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
#ifdef DEBUG