]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: enforce gap earlier in app reassembly
authorVictor Julien <victor@inliniac.net>
Fri, 3 Mar 2017 08:54:56 +0000 (09:54 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 20 Apr 2017 15:41:11 +0000 (17:41 +0200)
src/stream-tcp-reassemble.c

index 1ece2ae6902a36c1f226a133dd7892a889e41af5..5d4a067bc4ef5ba30d2637ec8e0cf3da64256c78 100644 (file)
@@ -1039,6 +1039,10 @@ int StreamTcpReassembleAppLayer (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
         SCLogDebug("stream no reassembly flag set or app-layer disabled.");
         SCReturnInt(0);
     }
+    if (stream->flags & STREAMTCP_STREAM_FLAG_GAP) {
+        SCReturnInt(0);
+    }
+
 
     SCLogDebug("stream->seg_list %p", stream->seg_list);
 #ifdef DEBUG
@@ -1123,10 +1127,6 @@ int StreamTcpReassembleAppLayer (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
         SCReturnInt(0);
     }
 
-    if (stream->flags & STREAMTCP_STREAM_FLAG_GAP) {
-        SCReturnInt(0);
-    }
-
     /* with all that out of the way, lets update the app-layer */
     return ReassembleUpdateAppLayer(tv, ra_ctx, ssn, stream, p, dir);
 }