From: Andreas Schwab Date: Tue, 27 Mar 2018 10:16:11 +0000 (+0200) Subject: Fix crash in resolver on memory allocation failure (bug 23005) X-Git-Tag: glibc-2.28~427 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f178e59fa5eefbbd37fde040ae8334aa5c857ee1;p=glibc.git Fix crash in resolver on memory allocation failure (bug 23005) --- diff --git a/ChangeLog b/ChangeLog index 111623dc70..77751d628d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-03-27 Andreas Schwab + + [BZ #23005] + * resolv/res_send.c (__res_context_send): Return ENOMEM if + allocation of private copy of nsaddr_list fails. + 2018-03-26 Joseph Myers [BZ #16552] 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; }