From: Philippe Antoine Date: Wed, 15 Jan 2025 19:59:12 +0000 (+0100) Subject: detect: fix overflow for files protocol X-Git-Tag: suricata-8.0.0-beta1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58a8559440a91df96cb27a2e899a7f7ecbbafc53;p=thirdparty%2Fsuricata.git detect: fix overflow for files protocol CID 1640392 Would happen only if we reached 15 protocols handling files --- diff --git a/src/detect-parse.c b/src/detect-parse.c index 60d202d6b7..7bc4ae0d6f 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -119,7 +119,9 @@ void DetectFileRegisterProto( al_protocols[i].direction = direction; al_protocols[i].to_client_progress = to_client_progress; al_protocols[i].to_server_progress = to_server_progress; - al_protocols[i + 1].alproto = ALPROTO_UNKNOWN; + if (i + 1 < ALPROTO_WITHFILES_MAX) { + al_protocols[i + 1].alproto = ALPROTO_UNKNOWN; + } } void DetectFileRegisterFileProtocols(DetectFileHandlerTableElmt *reg)