]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer/proto-detect: minor cleanup 4784/head
authorVictor Julien <victor@inliniac.net>
Mon, 6 Apr 2020 17:35:24 +0000 (19:35 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 6 Apr 2020 17:41:55 +0000 (19:41 +0200)
Make sure the mask calculation is u32.

src/app-layer-detect-proto.c

index a9c0ce2831adb6c109c434786af0831e781ab756..1c1509ea9d5c9a75ade664976dbca7d99548759a 100644 (file)
@@ -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)