From: Victor Julien Date: Mon, 6 Apr 2020 17:35:24 +0000 (+0200) Subject: app-layer/proto-detect: minor cleanup X-Git-Tag: suricata-6.0.0-beta1~556 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed8f48b05374a3335bc15969f2dde82540d18607;p=thirdparty%2Fsuricata.git app-layer/proto-detect: minor cleanup Make sure the mask calculation is u32. --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index a9c0ce2831..1c1509ea9d 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -645,12 +645,10 @@ static uint32_t AppLayerProtoDetectProbingParserGetMask(AppProto alproto) SCEnter(); if (!(alproto > ALPROTO_UNKNOWN && alproto < ALPROTO_FAILED)) { - SCLogError(SC_ERR_ALPARSER, "Unknown protocol detected - %"PRIu16, - alproto); - exit(EXIT_FAILURE); + FatalError(SC_ERR_ALPARSER, "Unknown protocol detected - %u", alproto); } - SCReturnUInt(1 << alproto); + SCReturnUInt(1UL << (uint32_t)alproto); } static AppLayerProtoDetectProbingParserElement *AppLayerProtoDetectProbingParserElementAlloc(void)