Skip to content

Commit

Permalink
tests: fuzzers: fix possible NULL deref
Browse files Browse the repository at this point in the history
We need to check for NULL here since we can cause mallocs to fail.

Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored and leonardo-albertovich committed Sep 26, 2023
1 parent 1ca1d02 commit 19a8a30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/internal/fuzzers/fstore_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)

cio_utils_recursive_delete(FSF_STORE_PATH);
fs = flb_fstore_create(FSF_STORE_PATH, FLB_FSTORE_FS);
if (fs == NULL) {
return 0;
}
st = flb_fstore_stream_create(fs, "abc");
if (st != NULL) {
fsf = flb_fstore_file_create(fs, st, "example.txt", size);
Expand Down

0 comments on commit 19a8a30

Please sign in to comment.