]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix crash in resolver on memory allocation failure (bug 23005)
authorAndreas Schwab <schwab@suse.de>
Thu, 17 May 2018 11:57:29 +0000 (13:57 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 17 May 2018 11:57:29 +0000 (13:57 +0200)
(cherry picked from commit f178e59fa5eefbbd37fde040ae8334aa5c857ee1)

ChangeLog
NEWS
resolv/res_send.c

index da8d9a5190505a8c8e7132e733e1a4edc40ec72a..05a15bc72eb67156cf0411743b63f74e3a09f010 100644 (file)
--- 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-27  Jesse Hathaway  <jesse@mbuki-mvuki.org>
 
        [BZ #23024]
diff --git a/NEWS b/NEWS
index dcbb2b0ff6fb20aba05f535d0484171874a83d30..4d360a426e8b612d60bb8011b8a243219c6546af 100644 (file)
--- 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
index 0ca02f98430500e5610b0a34cdccae95925e7629..83f35f60da718b9bd6c0a0e3a09bd058393c7105 100644 (file)
@@ -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;
        }