From 86f89e096643bd4790e6f5831267928f240410ec Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Mon, 4 Mar 2024 13:51:59 +0530 Subject: [PATCH] util/interval-tree: suppress cppcheck warnings Warning was: src/util-port-interval-tree.c:50:1: warning: Either the condition 'tmp!=NULL' is redundant or there is possible null pointer dereference: tmp. [nullPointerRedundantCheck] IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Assuming that condition 'tmp!=NULL' is not redundant IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Null pointer dereference IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: warning: Either the condition 'oleft!=NULL' is redundant or there is possible null pointer dereference: oleft. [nullPointerRedundantCheck] IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Assuming that condition 'oleft!=NULL' is not redundant IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Null pointer dereference IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: warning: Either the condition 'oright!=NULL' is redundant or there is possible null pointer dereference: oright. [nullPointerRedundantCheck] IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Assuming that condition 'oright!=NULL' is not redundant IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Null pointer dereference IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: warning: Either the condition 'left!=NULL' is redundant or there is possible null pointer dereference: left. [nullPointerRedundantCheck] IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Assuming that condition 'left!=NULL' is not redundant IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ src/util-port-interval-tree.c:50:1: note: Null pointer dereference IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); ^ --- src/util-port-interval-tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util-port-interval-tree.c b/src/util-port-interval-tree.c index fd49465764..53f8ef5508 100644 --- a/src/util-port-interval-tree.c +++ b/src/util-port-interval-tree.c @@ -47,6 +47,7 @@ static int SCPortIntervalCompareAndUpdate(const SCPortIntervalNode *a, SCPortInt SCReturnInt(-1); } +// cppcheck-suppress nullPointerRedundantCheck IRB_GENERATE(PI, SCPortIntervalNode, irb, SCPortIntervalCompareAndUpdate); /**