From e3f454bac0f968216699ca405c127c858f0657c7 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 11 Apr 2019 11:37:47 +0200 Subject: nss_dns: Do not replace root domain with empty string The purpose of the bp[0] == '.' check is unclear. Only the root domain starts with '.'. The empty string is accepted as a domain name in many places, denoting the root, but using it implicitly is confusing. --- resolv/nss_dns/dns-host.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'resolv/nss_dns/dns-host.c') diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index a18b8a6bf4..9c15f25f28 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -706,9 +706,6 @@ getanswer_r (struct resolv_context *ctx, n = -1; } - if (n > 0 && bp[0] == '.') - bp[0] = '\0'; - if (__glibc_unlikely (n < 0)) { *errnop = errno; -- cgit 1.4.1