If the name exists, but does not have the requested address type associated with it, getaddrinfo returns EAI_NONAME instead of EAI_NODATA for non-AF_UNSPEC lookups. (This seems to work correctly for AF_UNSPEC lookups.)
There are two different bugs in the code: The incorrect error handling in gethosts (bug 21915) and incorrect reporting of a zero return status from gethostbyname_r because h_errno is ignored.
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, master has been updated via 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d (commit) from 65329bd233db9d1b8b94e90734a564705b619260 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f8340f583fe3d4f5734bd2371c5a45ecff2db0d commit 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 09:15:36 2017 +0200 getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 ++++++ sysdeps/posix/getaddrinfo.c | 8 ++++++++ 2 files changed, 14 insertions(+), 0 deletions(-)
Fixed in 2.27.
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, master has been updated via f4a6be2582b8dfe8adfa68da3dd8decf566b3983 (commit) from 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4a6be2582b8dfe8adfa68da3dd8decf566b3983 commit f4a6be2582b8dfe8adfa68da3dd8decf566b3983 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 09:34:29 2017 +0200 getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922] The old code uses errno as the primary indicator for success or failure. This is wrong because errno is only set for specific combinations of the status return value and the h_errno variable. ----------------------------------------------------------------------- Summary of changes: ChangeLog | 14 +++++ nss/Makefile | 7 +++ nss/tst-nss-files-hosts-erange.c | 109 ++++++++++++++++++++++++++++++++++++++ resolv/tst-resolv-basic.c | 78 +++++++++++++++++++-------- sysdeps/posix/getaddrinfo.c | 42 +++++++-------- 5 files changed, 205 insertions(+), 45 deletions(-) create mode 100644 nss/tst-nss-files-hosts-erange.c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, release/2.26/master has been updated via a71a3374cd8cf53776c33994f69ec184c26f2129 (commit) via 7966331555df43bb7e2a55ce5a17a330e57f487f (commit) via 7ab87bccb657b02cac5a3360b11c67aff901de2e (commit) via 8f46c6052408a23a77ecf46aa378120c1a4afe37 (commit) via 701f7873da013fb19d9120317322cd78333e63c2 (commit) via bdd8422cfb1fe04cb20617495156fb232b00d23c (commit) from 5253749232749adb535d9b2bf7d43173b191ebef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a71a3374cd8cf53776c33994f69ec184c26f2129 commit a71a3374cd8cf53776c33994f69ec184c26f2129 Author: Florian Weimer <fweimer@redhat.com> Date: Mon Sep 4 11:27:24 2017 +0200 getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922] The old code uses errno as the primary indicator for success or failure. This is wrong because errno is only set for specific combinations of the status return value and the h_errno variable. (cherry picked from commit f4a6be2582b8dfe8adfa68da3dd8decf566b3983) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7966331555df43bb7e2a55ce5a17a330e57f487f commit 7966331555df43bb7e2a55ce5a17a330e57f487f Author: Florian Weimer <fweimer@redhat.com> Date: Mon Sep 4 11:25:34 2017 +0200 getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] (cherry picked from commit 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7ab87bccb657b02cac5a3360b11c67aff901de2e commit 7ab87bccb657b02cac5a3360b11c67aff901de2e Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:57:52 2017 +0200 getaddrinfo: In gaih_inet, use h_errno for certain status values only h_errno is not set for NSS_STATUS_SUCCESS, so its value might not be accurate at this point. (cherry picked from commit a2881ef01450295782b065f2f850f340d5c12c14) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f46c6052408a23a77ecf46aa378120c1a4afe37 commit 8f46c6052408a23a77ecf46aa378120c1a4afe37 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:57:28 2017 +0200 getaddrinfo: Properly set errno for NSS function lookup failure (cherry picked from commit ad816a5e00ce891a2cea8187638fa0e00f83aaf6) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=701f7873da013fb19d9120317322cd78333e63c2 commit 701f7873da013fb19d9120317322cd78333e63c2 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:57:07 2017 +0200 getaddrinfo: Use &h_errno has the h_errno pointer This simplifies the code because it is not necessary to propagate the temporary h_errno value to the thread-local variable. It also increases compatibility with NSS modules which update only one of the two places. (cherry picked from commit 53250a21b81474ef4e78090a4a9a63d8471e1091) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bdd8422cfb1fe04cb20617495156fb232b00d23c commit bdd8422cfb1fe04cb20617495156fb232b00d23c Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:56:46 2017 +0200 getaddrinfo: Use &errno has the errno pointer Similar code in nss/getXXbyYY_r.c is already using &errno as the argument. (cherry picked from commit 924b121c5978689001ae28cf1c8497371dad4f71) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 42 +++++++++++++ NEWS | 2 + nss/Makefile | 7 ++ nss/tst-nss-files-hosts-erange.c | 109 ++++++++++++++++++++++++++++++++++ resolv/tst-resolv-basic.c | 78 +++++++++++++++++------- sysdeps/posix/getaddrinfo.c | 122 +++++++++++++++++++------------------- 6 files changed, 276 insertions(+), 84 deletions(-) create mode 100644 nss/tst-nss-files-hosts-erange.c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU C Library master sources". The branch, release/2.25/master has been updated via fc7ef00f02ee41452245926a4f7ff2073711db33 (commit) via 8f8022df0773f4867d91068dce71539a4d1574ca (commit) via f67d3f0fa30d923c6e8631e85451da0fd94b86f3 (commit) via e75e7573e1a44faaea833eb1f390def5d6ab672f (commit) via bf19b5fdcde6bae47a17e6173f57f0606a8bd0e9 (commit) via 9bb04ec133b30fd106782b2105b8edca93b052e6 (commit) via c3fe737243b7661d8aca2d9f5d76e966f5c537df (commit) via 8871213e335854fbe1ae15a3c4b8ba2b7720cf1d (commit) via ea00a80db7c0cd1098f848eccd5d1f34d89b7faf (commit) via ab8b49432b302237015d0f44e858c17f92fe3a5b (commit) via 0e64ee798605a042a07604e8a4bf0ec00381e28b (commit) via e3ae300f3f2d1a94709b0f3fed2543b9449a09ca (commit) via e552550b409fda1369dc8f23c659c554632619e5 (commit) via 5515224932751ef13d382b7404fefc8e9c1057f5 (commit) via dc2d4b0ccd317108e3fa6f77bbbad238b4b01920 (commit) via 196990f97a0a3f28eab25e642f63f1294bf87722 (commit) via 346d7f942d1a0193792a6eedf696d797fd000369 (commit) via 84e7ab5b1ba14d60d0d76bb78217e254fd4615cf (commit) via 1ae1ef2e0d86d4b308636557122ca7a92a5ace80 (commit) via d3f885d7ea9e8a8aa142ccd69e6f85c1a4a70033 (commit) via d8bda0713bd898e9f962cee6d4e3d225441ef5a3 (commit) via dbdcd29e717ecd5217aa1e45a0ffe77a89a3f49b (commit) via 6bdff2e237fd167fadb7393c1fb31e0981a0687d (commit) via 0fdd895d7786babcae15ce923b3ae3eb54f6140e (commit) via eda5f13d712ae2631165698c017d03d739222f33 (commit) via b091ef7e2f6288a001423a5d037b34663996ffb5 (commit) via 8fbf5688edbaead49130b0d2f887335475a298e7 (commit) via 1f60575f88769d09c478caa2968b751bca6a90e3 (commit) via 8a4bf46fe7256b2713e568589b89c2275975586c (commit) from baf35427d678c86abff1c53594cd923cbcc961da (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fc7ef00f02ee41452245926a4f7ff2073711db33 commit fc7ef00f02ee41452245926a4f7ff2073711db33 Author: Florian Weimer <fweimer@redhat.com> Date: Thu Oct 19 10:44:31 2017 +0200 nss_files: Avoid large buffers with many host addresses [BZ #22078] The previous implementation had at least a quadratic space requirement in the number of host addresses and aliases. (cherry picked from commit d8425e116cdd954fea0c04c0f406179b5daebbb3) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f8022df0773f4867d91068dce71539a4d1574ca commit 8f8022df0773f4867d91068dce71539a4d1574ca Author: Florian Weimer <fweimer@redhat.com> Date: Wed Oct 11 07:01:34 2017 +0200 nss_files: Use struct scratch_buffer for gethostbyname [BZ #18023] (cherry picked from commit 78e806fd8cd8c918d3bbe1bcdf9091ab365e4a69) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f67d3f0fa30d923c6e8631e85451da0fd94b86f3 commit f67d3f0fa30d923c6e8631e85451da0fd94b86f3 Author: Florian Weimer <fweimer@redhat.com> Date: Tue Oct 10 11:50:41 2017 +0200 nss_files: Refactor gethostbyname3 multi case into separate function This is in preparation of further cleanup work. (cherry picked from commit 8ed70de2faceb4bd7b35bbdc2b7e8c83d9a297ba) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e75e7573e1a44faaea833eb1f390def5d6ab672f commit e75e7573e1a44faaea833eb1f390def5d6ab672f Author: Florian Weimer <fweimer@redhat.com> Date: Wed Jun 21 22:43:57 2017 +0200 Implement allocation buffers for internal use This commit adds fixed-size allocation buffers. The primary use case is in NSS modules, where dynamically sized data is stored in a fixed-size buffer provided by the caller. Other uses include a replacement of mempcpy cascades (which is safer due to the size checking inherent to allocation buffers). (cherry picked from commit 4dd8e7c0ce5ecc7f65e33e60ad2f717b31de32ec) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bf19b5fdcde6bae47a17e6173f57f0606a8bd0e9 commit bf19b5fdcde6bae47a17e6173f57f0606a8bd0e9 Author: Florian Weimer <fweimer@redhat.com> Date: Wed Sep 6 11:25:14 2017 +0200 __libc_dynarray_emplace_enlarge: Add missing else Before, arrays of small elements received a starting allocation size of 8, not 16. (cherry picked from commit ab5ac271e6210fa0af11cf3ca525ce573bc47c48) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9bb04ec133b30fd106782b2105b8edca93b052e6 commit 9bb04ec133b30fd106782b2105b8edca93b052e6 Author: Florian Weimer <fweimer@redhat.com> Date: Wed Aug 30 20:10:56 2017 +0200 dynarray: Set errno on overflow-induced allocation failure This allows the caller to return directly on such an error, with an appropriate errno value. (cherry picked from commit 5898f4548efdcd7c0fd437a74eeb80facc51a117) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c3fe737243b7661d8aca2d9f5d76e966f5c537df commit c3fe737243b7661d8aca2d9f5d76e966f5c537df Author: Florian Weimer <fweimer@redhat.com> Date: Tue Jun 13 17:03:56 2017 +0200 dynarray: Implement begin/end functions in the spirit of C++ (cherry picked from commit f8bf87face3304f216bcd838081fa33bb4976ac6) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8871213e335854fbe1ae15a3c4b8ba2b7720cf1d commit 8871213e335854fbe1ae15a3c4b8ba2b7720cf1d Author: Florian Weimer <fweimer@redhat.com> Date: Fri Jun 2 11:59:28 2017 +0200 Add internal facility for dynamic array handling This is intended as a type-safe alternative to obstacks and hand-written realloc constructs. The implementation avoids writing function pointers to the heap. (cherry picked from commit 91b6eb1140eda6bab324821ee3785e5d0ca155b8) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ea00a80db7c0cd1098f848eccd5d1f34d89b7faf commit ea00a80db7c0cd1098f848eccd5d1f34d89b7faf Author: Florian Weimer <fweimer@redhat.com> Date: Thu Jan 4 12:51:48 2018 +0100 Add check_mul_overflow_size_t Backported from commit 2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da. https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ab8b49432b302237015d0f44e858c17f92fe3a5b commit ab8b49432b302237015d0f44e858c17f92fe3a5b Author: Florian Weimer <fweimer@redhat.com> Date: Thu Jan 4 12:45:41 2018 +0100 Add <libc-pointer-arith.h> to help with backporting https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0e64ee798605a042a07604e8a4bf0ec00381e28b commit 0e64ee798605a042a07604e8a4bf0ec00381e28b Author: Florian Weimer <fweimer@redhat.com> Date: Thu Jan 4 12:32:36 2018 +0100 getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922] The old code uses errno as the primary indicator for success or failure. This is wrong because errno is only set for specific combinations of the status return value and the h_errno variable. (cherry picked from commit f4a6be2582b8dfe8adfa68da3dd8decf566b3983) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e3ae300f3f2d1a94709b0f3fed2543b9449a09ca commit e3ae300f3f2d1a94709b0f3fed2543b9449a09ca Author: Florian Weimer <fweimer@redhat.com> Date: Mon Sep 4 11:25:34 2017 +0200 getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] (cherry picked from commit 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e552550b409fda1369dc8f23c659c554632619e5 commit e552550b409fda1369dc8f23c659c554632619e5 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:57:52 2017 +0200 getaddrinfo: In gaih_inet, use h_errno for certain status values only h_errno is not set for NSS_STATUS_SUCCESS, so its value might not be accurate at this point. (cherry picked from commit a2881ef01450295782b065f2f850f340d5c12c14) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5515224932751ef13d382b7404fefc8e9c1057f5 commit 5515224932751ef13d382b7404fefc8e9c1057f5 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:57:28 2017 +0200 getaddrinfo: Properly set errno for NSS function lookup failure (cherry picked from commit ad816a5e00ce891a2cea8187638fa0e00f83aaf6) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dc2d4b0ccd317108e3fa6f77bbbad238b4b01920 commit dc2d4b0ccd317108e3fa6f77bbbad238b4b01920 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:57:07 2017 +0200 getaddrinfo: Use &h_errno has the h_errno pointer This simplifies the code because it is not necessary to propagate the temporary h_errno value to the thread-local variable. It also increases compatibility with NSS modules which update only one of the two places. (cherry picked from commit 53250a21b81474ef4e78090a4a9a63d8471e1091) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=196990f97a0a3f28eab25e642f63f1294bf87722 commit 196990f97a0a3f28eab25e642f63f1294bf87722 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Sep 1 08:56:46 2017 +0200 getaddrinfo: Use &errno has the errno pointer Similar code in nss/getXXbyYY_r.c is already using &errno as the argument. (cherry picked from commit 924b121c5978689001ae28cf1c8497371dad4f71) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=346d7f942d1a0193792a6eedf696d797fd000369 commit 346d7f942d1a0193792a6eedf696d797fd000369 Author: Florian Weimer <fweimer@redhat.com> Date: Tue Aug 8 18:48:05 2017 +0200 getaddrinfo: Remove unreachable return statement from gaih_inet (cherry picked from commit 0df595b23a829c9169ec418a19eef9006b4ae801) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=84e7ab5b1ba14d60d0d76bb78217e254fd4615cf commit 84e7ab5b1ba14d60d0d76bb78217e254fd4615cf Author: Florian Weimer <fweimer@redhat.com> Date: Sat Jun 24 16:51:31 2017 +0200 resolv/tst-resolv-basic: Add test cases for bug 21295 (cherry picked from commit 513a71a420e74270a6a9702ec916e807be51350a) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1ae1ef2e0d86d4b308636557122ca7a92a5ace80 commit 1ae1ef2e0d86d4b308636557122ca7a92a5ace80 Author: Dmitry Bilunov <kmeaw@kmeaw.com> Date: Thu Jan 4 11:33:53 2018 +0100 getaddrinfo: Merge IPv6 addresses and IPv4 addresses [BZ #21295] (cherry picked from commit 5cf88a83f27b0cd2d5a83511930e40d716c939eb) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d3f885d7ea9e8a8aa142ccd69e6f85c1a4a70033 commit d3f885d7ea9e8a8aa142ccd69e6f85c1a4a70033 Author: Florian Weimer <fweimer@redhat.com> Date: Thu May 11 11:32:16 2017 +0200 support_format_addrinfo: Fix flags and canonname formatting The address family splitting via format_ai_family made unpredictable the place where the canonname field was printed. This commit adjusts the implementation so that the ai_flags is checked for consistency across the list, and ai_canonname must only be present on the first list element. Tests for AI_CANONNAME are added to resolv/tst-resolv-basic. (cherry picked from commit 8ec69bb7ecf3ca5edde5b7d9d7d5d3a5f8b6c405) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d8bda0713bd898e9f962cee6d4e3d225441ef5a3 commit d8bda0713bd898e9f962cee6d4e3d225441ef5a3 Author: Florian Weimer <fweimer@redhat.com> Date: Thu Jan 4 11:45:20 2018 +0100 resolv: Support an exactly sized buffer in ns_name_pack [BZ #21359] This bug did not affect name resolution because those functions indirectly call ns_name_pack with a buffer which is always larger than the generated query packet, even in the case of the longest-possible domain name. (cherry picked from commit c803cb9b24c6cea15698768e4301e963b98e742c) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dbdcd29e717ecd5217aa1e45a0ffe77a89a3f49b commit dbdcd29e717ecd5217aa1e45a0ffe77a89a3f49b Author: Florian Weimer <fweimer@redhat.com> Date: Tue Apr 4 14:09:56 2017 +0200 resolv: Add test coverage for ns_name_unpack, ns_name_ntop (cherry picked from commit 07d6f1a3ca990e0e4f93b010605d4d87a3abdf24) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6bdff2e237fd167fadb7393c1fb31e0981a0687d commit 6bdff2e237fd167fadb7393c1fb31e0981a0687d Author: Florian Weimer <fweimer@redhat.com> Date: Wed Jun 21 13:35:37 2017 +0200 getaddrinfo: Avoid stack copy of IPv6 address (cherry picked from commit 76b8266f990a2912f42d1b7050840e8c7f14f2c2) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0fdd895d7786babcae15ce923b3ae3eb54f6140e commit 0fdd895d7786babcae15ce923b3ae3eb54f6140e Author: Florian Weimer <fweimer@redhat.com> Date: Wed Jun 21 13:09:08 2017 +0200 __inet_pton_length: Implement new internal helper function (cherry picked from commit 60149b28590be28051f99d0a343d7fbe002f2a8c) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eda5f13d712ae2631165698c017d03d739222f33 commit eda5f13d712ae2631165698c017d03d739222f33 Author: Florian Weimer <fweimer@redhat.com> Date: Thu May 11 14:48:51 2017 +0200 inet_pton: Reformat in GNU style Generated machine code is identical on x86-64. (cherry picked from commit d53b8652880ba42913f66e7eee0567ce4cfe7791) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b091ef7e2f6288a001423a5d037b34663996ffb5 commit b091ef7e2f6288a001423a5d037b34663996ffb5 Author: Florian Weimer <fweimer@redhat.com> Date: Sat Jun 3 08:37:13 2017 +0200 getaddrinfo: Eliminate another strdup call (cherry picked from commit 363911ce1313a246b7d33f0983a09e7ab2525b3a) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8fbf5688edbaead49130b0d2f887335475a298e7 commit 8fbf5688edbaead49130b0d2f887335475a298e7 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Jun 2 16:35:13 2017 +0200 getaddrinfo: Fix localplt failure involving strdup (cherry picked from commit 6257fcfd58479f6b7ae0fdde045b9ff144d543da) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1f60575f88769d09c478caa2968b751bca6a90e3 commit 1f60575f88769d09c478caa2968b751bca6a90e3 Author: Florian Weimer <fweimer@redhat.com> Date: Fri Jun 2 14:54:56 2017 +0200 getaddrinfo: Always allocate canonical name on the heap A further simplification could eliminate the canon variable in gaih_inet and replace it with canonbuf. However, canonbuf is used as a flag in the nscd code, which makes this somewhat non-straightforward. (cherry picked from commit 673cb072a4710bd4bf6029a062d2867cca929c43) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8a4bf46fe7256b2713e568589b89c2275975586c commit 8a4bf46fe7256b2713e568589b89c2275975586c Author: Florian Weimer <fweimer@redhat.com> Date: Thu May 11 10:01:49 2017 +0200 getaddrinfo: Unconditionally use malloc for address list getaddrinfo has to call malloc eventually anyway, so the complexity of avoiding malloc calls is not worth potential savings. (cherry picked from commit 46ce8881ade788db56079622f47f648d4aaa003b) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 253 +++++++++++++ NEWS | 5 + include/alloc_buffer.h | 367 +++++++++++++++++++ include/libc-pointer-arith.h | 1 + malloc/Makefile | 30 ++- malloc/Versions | 14 + malloc/alloc_buffer_alloc_array.c | 47 +++ malloc/alloc_buffer_allocate.c | 36 ++ malloc/alloc_buffer_copy_bytes.c | 34 ++ malloc/alloc_buffer_copy_string.c | 30 ++ malloc/alloc_buffer_create_failure.c | 31 ++ malloc/dynarray-skeleton.c | 521 ++++++++++++++++++++++++++ malloc/dynarray.h | 176 +++++++++ malloc/dynarray_at_failure.c | 31 ++ malloc/dynarray_emplace_enlarge.c | 73 ++++ malloc/dynarray_finalize.c | 62 ++++ malloc/dynarray_resize.c | 64 ++++ malloc/dynarray_resize_clear.c | 35 ++ malloc/malloc-internal.h | 19 + malloc/tst-alloc_buffer.c | 665 ++++++++++++++++++++++++++++++++++ malloc/tst-dynarray-at-fail.c | 125 +++++++ malloc/tst-dynarray-fail.c | 418 +++++++++++++++++++++ malloc/tst-dynarray-shared.h | 80 ++++ malloc/tst-dynarray.c | 574 +++++++++++++++++++++++++++++ nss/Makefile | 9 + nss/nss_files/files-hosts.c | 400 +++++++++++---------- nss/tst-nss-files-hosts-erange.c | 109 ++++++ nss/tst-nss-files-hosts-multi.c | 331 +++++++++++++++++ resolv/Makefile | 8 + resolv/Versions | 1 + resolv/inet_pton.c | 361 ++++++++++--------- resolv/ns_name.c | 2 +- resolv/resolv-internal.h | 9 + resolv/tst-inet_pton.c | 549 ++++++++++++++++++++++++++++ resolv/tst-ns_name.c | 438 ++++++++++++++++++++++ resolv/tst-ns_name.data | 548 ++++++++++++++++++++++++++++ resolv/tst-ns_name_compress.c | 75 ++++ resolv/tst-resolv-basic.c | 240 +++++++++++-- sysdeps/posix/getaddrinfo.c | 327 +++++++---------- 39 files changed, 6509 insertions(+), 589 deletions(-) create mode 100644 include/alloc_buffer.h create mode 100644 include/libc-pointer-arith.h create mode 100644 malloc/alloc_buffer_alloc_array.c create mode 100644 malloc/alloc_buffer_allocate.c create mode 100644 malloc/alloc_buffer_copy_bytes.c create mode 100644 malloc/alloc_buffer_copy_string.c create mode 100644 malloc/alloc_buffer_create_failure.c create mode 100644 malloc/dynarray-skeleton.c create mode 100644 malloc/dynarray.h create mode 100644 malloc/dynarray_at_failure.c create mode 100644 malloc/dynarray_emplace_enlarge.c create mode 100644 malloc/dynarray_finalize.c create mode 100644 malloc/dynarray_resize.c create mode 100644 malloc/dynarray_resize_clear.c create mode 100644 malloc/tst-alloc_buffer.c create mode 100644 malloc/tst-dynarray-at-fail.c create mode 100644 malloc/tst-dynarray-fail.c create mode 100644 malloc/tst-dynarray-shared.h create mode 100644 malloc/tst-dynarray.c create mode 100644 nss/tst-nss-files-hosts-erange.c create mode 100644 nss/tst-nss-files-hosts-multi.c create mode 100644 resolv/tst-inet_pton.c create mode 100644 resolv/tst-ns_name.c create mode 100644 resolv/tst-ns_name.data create mode 100644 resolv/tst-ns_name_compress.c