From: Daniel Salzman Date: Sun, 10 Aug 2025 05:58:19 +0000 (+0200) Subject: zonedb: fix possible NULL dereferences (Coverity) X-Git-Tag: v3.5.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c016bd333d994f588626bacdfbea85cd251ad0c;p=thirdparty%2Fknot-dns.git zonedb: fix possible NULL dereferences (Coverity) --- diff --git a/src/knot/zone/zonedb-load.c b/src/knot/zone/zonedb-load.c index 7858201165..4e2db0d463 100644 --- a/src/knot/zone/zonedb-load.c +++ b/src/knot/zone/zonedb-load.c @@ -414,6 +414,10 @@ static void reg_reverse(conf_t *conf, knot_zonedb_t *db_new, zone_t *zone) static void unreg_reverse(zone_t *zone) { + if (zone == NULL) { + return; + } + ptrnode_t *n; WALK_LIST(n, zone->reverse_from) { zone_local_notify_unsubscribe(n->d, zone); @@ -429,6 +433,10 @@ static void unreg_reverse(zone_t *zone) static bool same_group(zone_t *old_z, zone_t *new_z) { + if (old_z == NULL || new_z == NULL) { + return false; + } + if (old_z->catalog_group == NULL || new_z->catalog_group == NULL) { return (old_z->catalog_group == new_z->catalog_group); } else {