diff --git a/CHANGES b/CHANGES index 031d22a80e..766ecfa37c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1168. [bug] Empty also-notify clauses were not handled gracefully. + [RT #2309] + 1167. [contrib] nslint-2.1a3 (from author). 1166. [bug] "Not Implemented" should be reported as NOTIMP, diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 1483f900c5..f92fb6b4bb 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check.c,v 1.12 2001/12/17 22:56:58 marka Exp $ */ +/* $Id: check.c,v 1.13 2001/12/29 04:49:51 marka Exp $ */ #include @@ -60,6 +60,7 @@ static isc_result_t check_options(cfg_obj_t *options, isc_log_t *logctx) { isc_result_t result = ISC_R_SUCCESS; unsigned int i; + cfg_obj_t *obj = NULL; static intervaltable intervals[] = { { "cleaning-interval", 60, 28 * 24 * 60 }, /* 28 days */ @@ -79,7 +80,7 @@ check_options(cfg_obj_t *options, isc_log_t *logctx) { */ for (i = 0; i < sizeof(intervals) / sizeof(intervals[0]); i++) { isc_uint32_t val; - cfg_obj_t *obj = NULL; + obj = NULL; (void)cfg_map_get(options, intervals[i].name, &obj); if (obj == NULL) continue; @@ -97,6 +98,18 @@ check_options(cfg_obj_t *options, isc_log_t *logctx) { result = ISC_R_RANGE; } } + obj = NULL; + (void)cfg_map_get(options, "also-notify", &obj); + if (obj != NULL) { + cfg_obj_t *addrlist = NULL; + addrlist = cfg_tuple_get(obj, "addresses"); + if (cfg_list_first(addrlist) == NULL) { + cfg_obj_log(options, logctx, ISC_LOG_ERROR, + "empty 'also-notify' entry"); + if (result == ISC_R_SUCCESS) + result = ISC_R_FAILURE; + } + } return (result); }