Skip to content

Commit

Permalink
* sysdeps/posix/getaddrinfo.c (gaih_inet): After gethostbyname4_r
Browse files Browse the repository at this point in the history
	lookup, don't assign canon unconditionally.
  • Loading branch information
Ulrich Drepper committed May 16, 2008
1 parent 0caca71 commit 91c8a74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2008-05-16 Ulrich Drepper <drepper@redhat.com>

* sysdeps/posix/getaddrinfo.c (gaih_inet): After gethostbyname4_r
lookup, don't assign canon unconditionally.

2008-05-14 Ulrich Drepper <drepper@redhat.com>

* string/Makefile (distribute): Add str-two-way.h.
Expand Down
5 changes: 3 additions & 2 deletions sysdeps/posix/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ gaih_inet (const char *name, const struct gaih_service *service,

if (status == NSS_STATUS_SUCCESS)
{
canon = (*pat)->name;
if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)
canon = (*pat)->name;

while (*pat != NULL)
pat = &((*pat)->next);
Expand Down Expand Up @@ -953,7 +954,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
return -EAI_IDN_ENCODE;
}
/* In case the output string is the same as the input
string no new string has been allocated. Otherwise
string no new string has been allocated and we
make a copy. */
if (out == canon)
goto make_copy;
Expand Down

0 comments on commit 91c8a74

Please sign in to comment.