public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.37/master] getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
@ 2024-01-02 13:55 Florian Weimer
0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2024-01-02 13:55 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9b90e763dbee9899c5521481db6d4e92772ef526
commit 9b90e763dbee9899c5521481db6d4e92772ef526
Author: Andreas Schwab <schwab@suse.de>
Date: Wed Dec 6 14:48:22 2023 +0100
getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
When __resolv_context_get returns NULL due to out of memory, translate it
to a return value of EAI_MEMORY.
(cherry picked from commit 5eabdb6a6ac1599d23dd5966a37417215950245f)
Diff:
---
sysdeps/posix/getaddrinfo.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 69f38bbfb9..8607486798 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -616,7 +616,14 @@ get_nss_addresses (const char *name, const struct addrinfo *req,
function variant. */
res_ctx = __resolv_context_get ();
if (res_ctx == NULL)
- no_more = 1;
+ {
+ if (errno == ENOMEM)
+ {
+ result = -EAI_MEMORY;
+ goto out;
+ }
+ no_more = 1;
+ }
while (!no_more)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-02 13:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02 13:55 [glibc/release/2.37/master] getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163) Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).