public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] Fix crash in resolver on memory allocation failure (bug 23005)
@ 2021-08-28  0:37 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-28  0:37 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=da41ab8923709c52f4db76c8b5f5ea756f279359

commit da41ab8923709c52f4db76c8b5f5ea756f279359
Author: Andreas Schwab <schwab@suse.de>
Date:   Tue Mar 27 12:16:11 2018 +0200

    Fix crash in resolver on memory allocation failure (bug 23005)
    
    (cherry picked from commit f178e59fa5eefbbd37fde040ae8334aa5c857ee1)

Diff:
---
 ChangeLog         | 6 ++++++
 resolv/res_send.c | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index f9d7618431..89ecd49d19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2018-03-20  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #17343]
diff --git a/resolv/res_send.c b/resolv/res_send.c
index dde0425a33..7debf143f7 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;
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-28  0:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:37 [glibc/google/grte/v5-2.27/master] Fix crash in resolver on memory allocation failure (bug 23005) Fangrui Song

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).