From: Florian Weimer Date: Fri, 1 Sep 2017 07:15:36 +0000 (+0200) Subject: getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] X-Git-Tag: glibc-2.27~1000 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f8340f583fe3d4f5734bd2371c5a45ecff2db0d;p=thirdparty%2Fglibc.git getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] --- diff --git a/ChangeLog b/ChangeLog index a04985f2c36..2cb929635a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-09-01 Florian Weimer + + [BZ #21922] + * sysdeps/posix/getaddrinfo.c (gaih_inet): Report EAI_NODATA error + coming from gethostbyname2_r. + 2017-09-01 Florian Weimer * support/namespace.h (struct support_chroot_configuration): Add diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index acb5d9e73d0..0471a2f624d 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -618,6 +618,14 @@ gaih_inet (const char *name, const struct gaih_service *service, } *pat = addrmem; } + else + { + if (h_errno == NO_DATA) + result = -EAI_NODATA; + else + result = -EAI_NONAME; + goto free_and_return; + } } else {