]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: do not try to parse gaps during protocol change 5580/head
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 17 Nov 2020 09:16:42 +0000 (10:16 +0100)
committerPhilippe Antoine <contact@catenacyber.fr>
Thu, 19 Nov 2020 10:25:12 +0000 (11:25 +0100)
As this will leak the flow alstate because AppLayerParserParse
relies on FlowChangeProto to know if it should allocate a new
alstate

src/app-layer.c

index c5940e098ff42dc9e2d2450e649bb95afd691867..4c4a65cc22cad128734d13cb002f62d29062de76 100644 (file)
@@ -618,6 +618,11 @@ int AppLayerHandleTCPData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
                 goto failure;
             }
         }
+        if (FlowChangeProto(f)) {
+            FlowUnsetChangeProtoFlag(f);
+            SCLogDebug("Cannot handle gap while changing protocol");
+            goto failure;
+        }
         PACKET_PROFILING_APP_START(app_tctx, f->alproto);
         r = AppLayerParserParse(tv, app_tctx->alp_tctx, f, f->alproto,
                 flags, data, data_len);