This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] nss_dns: Do not call res_dnok in getnetby* implementation
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 08 Mar 2019 21:44:23 +0100
- Subject: [PATCH] nss_dns: Do not call res_dnok in getnetby* implementation
The argument to res_dnok was produced by ns_name_ntop, so it
is a syntactically valid domain name which, in textual format,
only consists of printable characters. Therefore, the res_dnok
check always passes.
2019-03-08 Florian Weimer <fweimer@redhat.com>
* resolv/nss_dns/dns-network.c (getanswer_r): Do not call
res_dnok.
diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c
index 4b81b1bfdc..4617b165db 100644
--- a/resolv/nss_dns/dns-network.c
+++ b/resolv/nss_dns/dns-network.c
@@ -348,7 +348,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
if (n > 0 && bp[0] == '.')
bp[0] = '\0';
- if (n < 0 || res_dnok (bp) == 0)
+ if (n < 0)
break;
cp += n;
@@ -382,7 +382,7 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
n = -1;
}
- if (n < 0 || !res_hnok (bp))
+ if (n < 0)
{
/* XXX What does this mean? The original form from bind
returns NULL. Incrementing cp has no effect in any case.