public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Andreas Schwab <schwab@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163) Date: Tue, 2 Jan 2024 10:11:30 +0000 (GMT) [thread overview] Message-ID: <20240102101130.BC8D23858419@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5eabdb6a6ac1599d23dd5966a37417215950245f commit 5eabdb6a6ac1599d23dd5966a37417215950245f 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. Diff: --- nss/getaddrinfo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c index a225f9b0fd..3ccd3905fa 100644 --- a/nss/getaddrinfo.c +++ b/nss/getaddrinfo.c @@ -615,7 +615,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) {
reply other threads:[~2024-01-02 10:11 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240102101130.BC8D23858419@sourceware.org \ --to=schwab@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).