From: Philippe Antoine Date: Fri, 22 Jan 2021 14:55:31 +0000 (+0100) Subject: protocol detection: fix failure case X-Git-Tag: suricata-7.0.0-beta1~1843 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76db6e34a1e54346fb6881c50abb1fc45f8d7103;p=thirdparty%2Fsuricata.git protocol detection: fix failure case as reached by CIFuzz even if unreachable from Suricata --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index f05c827f80..c123e12e3f 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -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];