fuzz: restrict flags passed to AppLayerProtoDetectGetProto

Completes commit 05f9b3ffc6
pull/6642/head
Philippe Antoine 4 years ago committed by Victor Julien
parent 7732efbec2
commit f4449d3fb3

@ -68,7 +68,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
* Otherwise, we have evasion with TCP splitting * Otherwise, we have evasion with TCP splitting
*/ */
for (size_t i = 0; i < size-HEADER_LEN && i < PROTO_DETECT_MAX_LEN; i++) { 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) { if (alproto2 != ALPROTO_UNKNOWN && alproto2 != alproto) {
printf("Failed with input length %" PRIuMAX " versus %" PRIuMAX printf("Failed with input length %" PRIuMAX " versus %" PRIuMAX
", found %s instead of %s\n", ", found %s instead of %s\n",

Loading…
Cancel
Save