aboutsummaryrefslogtreecommitdiff
path: root/resolv
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2018-03-27 12:16:11 +0200
committerAndreas Schwab <schwab@suse.de>2018-03-27 17:26:32 +0200
commitf178e59fa5eefbbd37fde040ae8334aa5c857ee1 (patch)
treed23e236dd00c5b54e13226f2c32c2be64bc0515f /resolv
parent5f45f96ad09d7f80172b45dca16d6ca2baeea2a8 (diff)
downloadglibc-f178e59fa5eefbbd37fde040ae8334aa5c857ee1.tar
glibc-f178e59fa5eefbbd37fde040ae8334aa5c857ee1.tar.gz
glibc-f178e59fa5eefbbd37fde040ae8334aa5c857ee1.tar.bz2
glibc-f178e59fa5eefbbd37fde040ae8334aa5c857ee1.zip
Fix crash in resolver on memory allocation failure (bug 23005)
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res_send.c5
1 files changed, 5 insertions, 0 deletions
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;
}