]> 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>
Tue, 24 Sep 2024 04:56:22 +0000 (06:56 +0200)
Bug: #6875.
(cherry picked from commit 0be3ba802e1433632e48a7160cc6ae9fbe4c239e)

src/output-json-alert.c

index e74906b7bea71d1d04d5df240cd2f7428f273d48..8dade1901bac3b839583059ab47af085ea20c76b 100644 (file)
@@ -881,8 +881,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) {