From 7e76da18f20a0f43afc9cd9ecc10d2f1fcedca27 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 4 May 2020 14:23:23 -0700 Subject: [PATCH] Fix outstanding cppcheck errors lib/dns/sdb.c:1145:warning: Either the condition '(sdb)!=((void*)0)' is redundant or there is possible null pointer dereference: sdb." lib/dns/sdb.c:1208: Either the condition '(node)!=((void*)0)' is redundant or there is possible null pointer dereference: sdbnode. --- lib/dns/sdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index d4c8c673c8..8afaa52fb1 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -1141,11 +1141,13 @@ createiterator(dns_db_t *db, unsigned int options, dns_dbiterator_t **iteratorp) { dns_sdb_t *sdb = (dns_sdb_t *)db; sdb_dbiterator_t *sdbiter; - dns_sdbimplementation_t *imp = sdb->implementation; + dns_sdbimplementation_t *imp; isc_result_t result; REQUIRE(VALID_SDB(sdb)); + imp = sdb->implementation; + if (imp->methods->allnodes == NULL) return (ISC_R_NOTIMPLEMENTED); @@ -1193,7 +1195,7 @@ findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, dns_rdatalist_t *list; dns_sdbnode_t *sdbnode = (dns_sdbnode_t *)node; - REQUIRE(VALID_SDBNODE(node)); + REQUIRE(VALID_SDBNODE(sdbnode)); UNUSED(db); UNUSED(version);