Skip to content

Commit

Permalink
Merge branch 'issue662' of github.com:RoaringBitmap/CRoaring into iss…
Browse files Browse the repository at this point in the history
…ue662
  • Loading branch information
lemire committed Oct 6, 2024
2 parents ce39ed8 + 3454335 commit 8ae5ae8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
14 changes: 14 additions & 0 deletions fuzz/croaring_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ int bitmap64(const char *data, size_t size) {
}
return 0;
}
<<<<<<< HEAD

int LLVMFuzzerTestOneInput(const char *data, size_t size) {
if (size == 0) {
Expand All @@ -88,4 +89,17 @@ int LLVMFuzzerTestOneInput(const char *data, size_t size) {
} else {
return bitmap64(data + 1, size - 1);
}
=======
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;
}
return 0;
>>>>>>> 345433598c21c4e35f817a0cc01d023c949961d1
}
5 changes: 3 additions & 2 deletions include/roaring/roaring.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,9 @@ roaring_bitmap_t *roaring_bitmap_portable_deserialize(const char *buf);
* bitmap prior to using it. Only after calling roaring_bitmap_internal_validate
* is the bitmap considered safe for use.
*
* We also recommend that you use checksums to check that serialized data corresponds
* to the serialized bitmap. The CRoaring library does not provide checksumming.
* We also recommend that you use checksums to check that serialized data
* corresponds to the serialized bitmap. The CRoaring library does not provide
* checksumming.
*
* This function is endian-sensitive. If you have a big-endian system (e.g., a
* mainframe IBM s390x), the data format is going to be big-endian and not
Expand Down
9 changes: 5 additions & 4 deletions include/roaring/roaring64.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,12 @@ size_t roaring64_bitmap_portable_deserialize_size(const char *buf,
*
* If the source is untrusted, you should call
* roaring64_bitmap_internal_validate to check the validity of the
* bitmap prior to using it. Only after calling roaring64_bitmap_internal_validate
* is the bitmap considered safe for use.
* bitmap prior to using it. Only after calling
* roaring64_bitmap_internal_validate is the bitmap considered safe for use.
*
* We also recommend that you use checksums to check that serialized data corresponds
* to the serialized bitmap. The CRoaring library does not provide checksumming.
* We also recommend that you use checksums to check that serialized data
* corresponds to the serialized bitmap. The CRoaring library does not provide
* checksumming.
*
* This function is endian-sensitive. If you have a big-endian system (e.g., a
* mainframe IBM s390x), the data format is going to be big-endian and not
Expand Down

0 comments on commit 8ae5ae8

Please sign in to comment.