mirror of
https://github.com/google/brotli.git
synced 2024-11-24 12:30:15 +00:00
fuzz: make target resist allocation failures (#1023)
So that fuzzing can go on with simulated allocation failures
This commit is contained in:
parent
1d8452b783
commit
bfa15d4046
@ -27,6 +27,11 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
size_t total_out = 0;
|
||||
|
||||
BrotliDecoderState* state = BrotliDecoderCreateInstance(0, 0, 0);
|
||||
if (!state) {
|
||||
// OOM is out-of-scope here.
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (addend == 0)
|
||||
addend = size;
|
||||
|
Loading…
Reference in New Issue
Block a user