From 243134ef3aba940c92ef84ff342acf690cc77db8 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 1 May 2020 10:52:50 +0200 Subject: [PATCH] Do not test node for null, the loop guarantees node is not null. Found by Coverity (1419400), which concludes that if node could be null, the following node->node.first.getBits() would deref a nullptr. --- pdns/iputils.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 2fb2805055..968864100a 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -989,7 +989,7 @@ public: // we turn left on 0 and right on 1 int bits = 0; - for(; node && bits < key.getBits(); bits++) { + for(; bits < key.getBits(); bits++) { bool vall = key.getBit(-1-bits); if (bits >= node->d_bits) { -- 2.47.2