From 1e1a4ab1c40b53dca6d24b848bf8abc69f282622 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 9 Dec 2021 15:40:09 +0100 Subject: [PATCH] detect: logs an error if a protocol is disabled So that the user knows that the rule cannot match --- src/detect-parse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/detect-parse.c b/src/detect-parse.c index e3cb589729..e52a20aae1 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1507,6 +1507,11 @@ int DetectSignatureSetAppProto(Signature *s, AppProto alproto) } } + if (AppLayerProtoDetectGetProtoName(alproto) == NULL) { + SCLogError(SC_ERR_INVALID_ARGUMENT, "disabled alproto %s, rule can never match", + AppProtoToString(alproto)); + return -1; + } s->alproto = alproto; s->flags |= SIG_FLAG_APPLAYER; return 0; -- 2.47.2