]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
protocol detection: fix failure case
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 22 Jan 2021 14:55:31 +0000 (15:55 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 23 Jan 2021 08:57:31 +0000 (09:57 +0100)
as reached by CIFuzz even if unreachable from Suricata

src/app-layer-detect-proto.c

index f05c827f807e16bc5fe66bbfdabb46bdd5583e44..c123e12e3f582b0dbafe80b8e164b8b41a752241 100644 (file)
@@ -329,8 +329,10 @@ static AppProto AppLayerProtoDetectPMGetProto(
     MpmThreadCtx *mpm_tctx;
     int m = -1;
 
-    if (f->protomap >= FLOW_PROTO_DEFAULT)
-        return ALPROTO_FAILED;
+    if (f->protomap >= FLOW_PROTO_DEFAULT) {
+        pm_results[0] = ALPROTO_FAILED;
+        SCReturnUInt(1);
+    }
 
     if (direction & STREAM_TOSERVER) {
         pm_ctx = &alpd_ctx.ctx_ipp[f->protomap].ctx_pm[0];