public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: fweimer@redhat.com (Florian Weimer)
To: libc-stable@sourceware.org
Subject: [2.26 COMMITTED] Fix crash in resolver on memory allocation failure (bug 23005)
Date: Mon, 01 Jan 2018 00:00:00 -0000	[thread overview]
Message-ID: <20180517124340.8402643985E65@oldenburg.str.redhat.com> (raw)

From: Andreas Schwab <schwab@suse.de>

(cherry picked from commit f178e59fa5eefbbd37fde040ae8334aa5c857ee1)

2018-03-27  Andreas Schwab  <schwab@suse.de>

	[BZ #23005]
	* resolv/res_send.c (__res_context_send): Return ENOMEM if
	allocation of private copy of nsaddr_list fails.

diff --git a/NEWS b/NEWS
index dcbb2b0ff6..4d360a426e 100644
--- a/NEWS
+++ b/NEWS
@@ -118,6 +118,7 @@ The following bugs are resolved with this release:
   [22685] powerpc: Fix syscalls during early process initialization
   [22715] x86-64: Properly align La_x86_64_retval to VEC_SIZE
   [22774] malloc: Integer overflow in malloc (CVE-2018-6551)
+  [23005] resolv: Fix crash in resolver on memory allocation failure
   [23024] getlogin_r: return early when linux sentinel value is set
   [23037] resolv: Fully initialize struct mmsghdr in send_dg
 \f
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 0ca02f9843..83f35f60da 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -471,6 +471,11 @@ __res_context_send (struct resolv_context *ctx,
 					'\0',
 					sizeof (struct sockaddr_in6)
 					- sizeof (struct sockaddr_in));
+			else
+			  {
+			    __set_errno (ENOMEM);
+			    return -1;
+			  }
 		}
 		EXT(statp).nscount = statp->nscount;
 	}

                 reply	other threads:[~2018-05-17 12:43 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=20180517124340.8402643985E65@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-stable@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: link
Be 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).