From fe51e068f0892ae9258d9fd0e14fe2a469ff8edf Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 17 Sep 2015 08:51:25 +1000 Subject: [PATCH] 4208. [bug] Address null pointer dereferences on out of memory. [RT #40764] --- CHANGES | 3 +++ bin/named/zoneconf.c | 2 ++ bin/nsupdate/nsupdate.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 0c687d900a..b63f9a348e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4208. [bug] Address null pointer dereferences on out of memory. + [RT #40764] + 4207. [bug] Handle class mismatches with raw zone files. [RT #40746] diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index e46c52e1c7..335519a139 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -903,6 +903,8 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, len = strlen(dlzname) + 5; cpval = isc_mem_allocate(mctx, len); + if (cpval == NULL) + return (ISC_R_NOMEMORY); snprintf(cpval, len, "dlz %s", dlzname); } diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index eca42b4f8b..c6c7ef90e8 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -641,6 +641,8 @@ read_sessionkey(isc_mem_t *mctx, isc_log_t *lctx) { len = strlen(algorithm) + strlen(mykeyname) + strlen(secretstr) + 3; keystr = isc_mem_allocate(mctx, len); + if (keystr == NULL) + fatal("out of memory"); snprintf(keystr, len, "%s:%s:%s", algorithm, mykeyname, secretstr); setup_keystr();