From 1b96d74ae2b488aa71e0d4ae9a38e7a07a5cecd4 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] (cherry picked from commit fe51e068f0892ae9258d9fd0e14fe2a469ff8edf) --- CHANGES | 3 +++ bin/named/zoneconf.c | 2 ++ bin/nsupdate/nsupdate.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/CHANGES b/CHANGES index 8c2b2eed64..3031ea2b4b 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 202fa2c91a..85dee041dd 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -905,6 +905,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 ecd9c8b7a0..a5aae01f64 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -640,6 +640,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();