Skip to content

Commit

Permalink
separating out the 32-bit and 64-bit fuzzers (#672)
Browse files Browse the repository at this point in the history
* separating out the 32-bit and 64-bit fuzzers

* lint

* missing header
  • Loading branch information
lemire authored Oct 2, 2024
1 parent b8d62f9 commit ecc8e06
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fuzz/croaring_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string.h>

#include "roaring/roaring.h"
#include "roaring/roaring64.h"

int bitmap32(const char *data, size_t size) {
// We test that deserialization never fails.
Expand Down Expand Up @@ -77,15 +78,14 @@ 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;
if (size == 0) {
return 0;
}
r = bitmap64(data, size);
if (r) {
return r;
if (data[0] % 2 == 0) {
return bitmap32(data + 1, size - 1);
} else {
return bitmap64(data + 1, size - 1);
}
return 0;
}

0 comments on commit ecc8e06

Please sign in to comment.