c6d234
commit f178e59fa5eefbbd37fde040ae8334aa5c857ee1
c6d234
Author: Andreas Schwab <schwab@suse.de>
c6d234
Date:   Tue Mar 27 12:16:11 2018 +0200
c6d234
c6d234
    Fix crash in resolver on memory allocation failure (bug 23005)
c6d234
c6d234
diff --git a/resolv/res_send.c b/resolv/res_send.c
c6d234
index b396aae03c9eeb6e..01e4da4188b63d39 100644
c6d234
--- a/resolv/res_send.c
c6d234
+++ b/resolv/res_send.c
c6d234
@@ -471,6 +471,11 @@ __res_context_send (struct resolv_context *ctx,
c6d234
 					'\0',
c6d234
 					sizeof (struct sockaddr_in6)
c6d234
 					- sizeof (struct sockaddr_in));
c6d234
+			else
c6d234
+			  {
c6d234
+			    __set_errno (ENOMEM);
c6d234
+			    return -1;
c6d234
+			  }
c6d234
 		}
c6d234
 		EXT(statp).nscount = statp->nscount;
c6d234
 	}