1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

Fix crash on reloading of gai data in nscd.

This commit is contained in:
Ulrich Drepper
2010-04-09 21:38:20 -07:00
parent 17ad387727
commit ea42a20cae
3 changed files with 16 additions and 18 deletions

View File

@@ -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;
}