]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/alert: fix validation check
authorVictor Julien <vjulien@oisf.net>
Wed, 20 Mar 2024 06:18:44 +0000 (07:18 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 22 Mar 2024 06:52:32 +0000 (07:52 +0100)
Bug: #6875.

src/output-json-alert.c

index fd11e08a49897511882f38165b79696a579021eb..18a14a0fc5051efc20e2abb3ea80a34c984c992e 100644 (file)
@@ -656,8 +656,8 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p)
             int stream = (p->proto == IPPROTO_TCP) ?
                          (pa->flags & (PACKET_ALERT_FLAG_STATE_MATCH | PACKET_ALERT_FLAG_STREAM_MATCH) ?
                          1 : 0) : 0;
-            DEBUG_VALIDATE_BUG_ON(
-                    p->flow == NULL); // should be impossible, but scan-build got confused
+            // should be impossible, as stream implies flow
+            DEBUG_VALIDATE_BUG_ON(stream && p->flow == NULL);
 
             /* Is this a stream?  If so, pack part of it into the payload field */
             if (stream && p->flow != NULL) {