]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: suppress scan-build warnings
authorVictor Julien <victor@inliniac.net>
Thu, 25 Oct 2018 15:02:43 +0000 (17:02 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Oct 2018 09:21:34 +0000 (10:21 +0100)
src/detect.c
src/util-validate.h

index f774417883b45d0eb36b2ea8b3dd3cf59aea20a0..b83ca708a7090bedd08644ad2d3a24847eb28ed0 100644 (file)
@@ -596,6 +596,8 @@ static inline int DetectRunInspectRuleHeader(
      * and if so, if we actually have any in the flow. If not, the sig
      * can't match and we skip it. */
     if ((p->flags & PKT_HAS_FLOW) && (sflags & SIG_FLAG_REQUIRE_FLOWVAR)) {
+        DEBUG_VALIDATE_BUG_ON(f == NULL);
+
         int m  = f->flowvar ? 1 : 0;
 
         /* no flowvars? skip this sig */
@@ -934,6 +936,8 @@ static DetectRunScratchpad DetectRunSetup(
 
     /* grab the protocol state we will detect on */
     if (p->flags & PKT_HAS_FLOW) {
+        DEBUG_VALIDATE_BUG_ON(pflow == NULL);
+
         if (p->flowflags & FLOW_PKT_TOSERVER) {
             flow_flags = STREAM_TOSERVER;
             SCLogDebug("flag STREAM_TOSERVER set");
index c0dac20b78be49c3faee614af57d6a017389936a..5f23fd75dbe9844fbcef3e126069891bb2851282 100644 (file)
 
 #define DEBUG_VALIDATE_BUG_ON(exp) BUG_ON((exp))
 
+#elif defined(__clang_analyzer__)
+
+#define DEBUG_ASSERT_FLOW_LOCKED(f)
+#define DEBUG_VALIDATE_FLOW(f)
+#define DEBUG_VALIDATE_PACKET(p)
+#define DEBUG_VALIDATE_BUG_ON(exp) BUG_ON((exp))
+
 #else /* DEBUG_VALIDATE */
 
 #define DEBUG_ASSERT_FLOW_LOCKED(f)