1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Meta: Return 0 from the fuzzing function in most cases

LibFuzzer documentation [1] states that all return values except for 0
and -1 are currently reserved for future use. -1 is a special return
value that causes LibFuzzer to not add a testing input to the testing
corpus, regardless of the code coverage that it causes.

[1] https://llvm.org/docs/LibFuzzer.html
This commit is contained in:
Tim Schumacher 2022-12-05 02:08:04 +01:00 committed by Andrew Kaster
parent eabb0be7ea
commit 20f0858f67
12 changed files with 20 additions and 23 deletions

View file

@ -13,12 +13,12 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
auto bufstream_result = Core::Stream::MemoryStream::construct({ data, size });
if (bufstream_result.is_error()) {
dbgln("MemoryStream::construct() failed.");
return 1;
return 0;
}
auto bufstream = bufstream_result.release_value();
auto brotli_stream = Compress::BrotliDecompressionStream { *bufstream };
auto uncompressed = brotli_stream.read_all();
return uncompressed.is_error();
(void)brotli_stream.read_all();
return 0;
}