]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode: prevent segfault on bypass without flow 4191/head
authorEric Leblond <eric@regit.org>
Fri, 24 May 2019 21:37:49 +0000 (23:37 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 11 Sep 2019 06:51:14 +0000 (08:51 +0200)
When using a rule like:
pass ip any any -> any any (msg:"Bypass"; sid:1; rev:1;)

We could get a match even in case of flow exhaustion where the
Packet has no Flow attached.

src/decode.c

index 6094c7292468316845401db1f74ba65d95c2ff39..e3773b530cf6b7845ec2f9ac1161d36230ff5791 100644 (file)
@@ -399,6 +399,9 @@ void PacketDefragPktSetupParent(Packet *parent)
 
 void PacketBypassCallback(Packet *p)
 {
+    if (p->flow == NULL) {
+        return;
+    }
     /* Don't try to bypass if flow is already out or
      * if we have failed to do it once */
     int state = SC_ATOMIC_GET(p->flow->flow_state);