diff options
author | Ulrich Drepper <drepper@redhat.com> | 2010-04-09 21:38:20 -0700 |
---|---|---|
committer | Petr Baudis <pasky@ucw.cz> | 2010-05-12 03:21:17 +0200 |
commit | 39879d17a46e063c674ecf5532cb8c1f49fc7277 (patch) | |
tree | 3b8faed42a022c2380908d03deb220cd1dffcb17 /resolv | |
parent | 1aa9c16a2a1b297b31793b99cc3d5d67e720edb2 (diff) | |
download | glibc-39879d17a46e063c674ecf5532cb8c1f49fc7277.tar.gz glibc-39879d17a46e063c674ecf5532cb8c1f49fc7277.tar.xz glibc-39879d17a46e063c674ecf5532cb8c1f49fc7277.zip |
Fix crash on reloading of gai data in nscd.
(cherry picked from commit ea42a20caed5b343ff20a0d4622ae6c17b77161b)
Diffstat (limited to 'resolv')
-rw-r--r-- | resolv/nss_dns/dns-host.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index e0c4978c3b..8592183f62 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -1050,7 +1050,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, ++had_error; continue; } - if (*firstp) + if (*firstp && canon == NULL) { h_name = buffer; buffer += h_namelen; @@ -1166,19 +1166,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, if (ttl != 0 && ttlp != NULL) *ttlp = ttl; - if (canon != NULL) - { - (*pat)->name = canon; - - /* Reclaim buffer space. */ - if (h_name + h_namelen == buffer) - { - buffer = h_name; - buflen += h_namelen; - } - } - else - (*pat)->name = h_name; + (*pat)->name = canon ?: h_name; *firstp = 0; } |