From 08fc3cec73e845a002584c6938bd3dda0da6fba0 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Wed, 2 Oct 2024 08:08:09 -0400 Subject: [PATCH] separating out the 32-bit and 64-bit fuzzers --- fuzz/croaring_fuzzer.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/fuzz/croaring_fuzzer.c b/fuzz/croaring_fuzzer.c index 4c652378..3cd4b312 100644 --- a/fuzz/croaring_fuzzer.c +++ b/fuzz/croaring_fuzzer.c @@ -77,15 +77,12 @@ int bitmap64(const char *data, size_t size) { } return 0; } + int LLVMFuzzerTestOneInput(const char *data, size_t size) { - int r; - r = bitmap32(data, size); - if (r) { - return r; - } - r = bitmap64(data, size); - if (r) { - return r; + if (size == 0) { return 0; } + if (data[0] % 2 == 0) { + return bitmap32(data + 1, size - 1); + } else { + return bitmap64(data + 1, size - 1); } - return 0; }