From: Philippe Antoine Date: Tue, 23 Nov 2021 21:13:56 +0000 (+0100) Subject: fuzz: restrict flags passed to AppLayerProtoDetectGetProto X-Git-Tag: suricata-7.0.0-beta1~1149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4449d3fb3d4ccf83d7065a5f4bb017c1079460e;p=thirdparty%2Fsuricata.git fuzz: restrict flags passed to AppLayerProtoDetectGetProto Completes commit 05f9b3ffc687d1afcfc5984ac9f0ce1888d06bf5 --- diff --git a/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c b/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c index 8633a536f9..e9df4db8eb 100644 --- a/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c +++ b/src/tests/fuzz/fuzz_applayerprotodetectgetproto.c @@ -68,7 +68,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) * Otherwise, we have evasion with TCP splitting */ for (size_t i = 0; i < size-HEADER_LEN && i < PROTO_DETECT_MAX_LEN; i++) { - alproto2 = AppLayerProtoDetectGetProto(alpd_tctx, f, data+HEADER_LEN, i, f->proto, data[0], &reverse); + alproto2 = AppLayerProtoDetectGetProto( + alpd_tctx, f, data + HEADER_LEN, i, f->proto, flags, &reverse); if (alproto2 != ALPROTO_UNKNOWN && alproto2 != alproto) { printf("Failed with input length %" PRIuMAX " versus %" PRIuMAX ", found %s instead of %s\n",