From 53a33f736547e0bafae9b6228107e09592b98f17 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 14 Dec 2018 16:29:02 +1100 Subject: [PATCH] pass the correct object to cfg_obj_log --- CHANGES | 4 ++++ .../checkconf/bad-stub-masters-dialup.conf | 23 +++++++++++++++++++ lib/bind9/check.c | 8 +++---- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 bin/tests/system/checkconf/bad-stub-masters-dialup.conf diff --git a/CHANGES b/CHANGES index 23976a5918..9e6f2b2982 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5112. [bug] Named/named-checkconf could dump core if there was + a missing masters clause and a bad notify clause. + [GL #779] + 5111. [bug] Occluded DNSKEY records could make it into the delegating NSEC/NSEC3 bitmap. [GL #742] diff --git a/bin/tests/system/checkconf/bad-stub-masters-dialup.conf b/bin/tests/system/checkconf/bad-stub-masters-dialup.conf new file mode 100644 index 0000000000..750daf886f --- /dev/null +++ b/bin/tests/system/checkconf/bad-stub-masters-dialup.conf @@ -0,0 +1,23 @@ +controls { /* empty */ }; +options { + query-source address 10.53.0.2; + notify-source 10.53.0.2; + transfer-source 10.53.0.2; + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.2; }; + listen-on-v6 { none; }; + heartbeat-interval 2; + recursion no; +}; +zone "." { + type hint; + file "hint"; +}; +zone "example." { + type stub; + dialup notify; + notify no; + file "example.bk"; + // masters { 10.53.0.1; }; +}; diff --git a/lib/bind9/check.c b/lib/bind9/check.c index d03c33954c..2261143229 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -2434,10 +2434,10 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, if (ztype == CFG_ZONE_MASTER || ztype == CFG_ZONE_SLAVE || ztype == CFG_ZONE_STUB) { - const cfg_obj_t *dialup = NULL; - (void)cfg_map_get(zoptions, "dialup", &dialup); - if (dialup != NULL && cfg_obj_isstring(dialup)) { - const char *str = cfg_obj_asstring(dialup); + obj = NULL; + (void)cfg_map_get(zoptions, "dialup", &obj); + if (obj != NULL && cfg_obj_isstring(obj)) { + const char *str = cfg_obj_asstring(obj); for (i = 0; i < sizeof(dialups) / sizeof(dialups[0]); i++)