Skip to content

Commit 19a8a30

Browse files
DavidKorczynskileonardo-albertovich
authored andcommitted
tests: fuzzers: fix possible NULL deref
We need to check for NULL here since we can cause mallocs to fail. Signed-off-by: David Korczynski <[email protected]>
1 parent 1ca1d02 commit 19a8a30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/internal/fuzzers/fstore_fuzzer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
6161

6262
cio_utils_recursive_delete(FSF_STORE_PATH);
6363
fs = flb_fstore_create(FSF_STORE_PATH, FLB_FSTORE_FS);
64+
if (fs == NULL) {
65+
return 0;
66+
}
6467
st = flb_fstore_stream_create(fs, "abc");
6568
if (st != NULL) {
6669
fsf = flb_fstore_file_create(fs, st, "example.txt", size);

0 commit comments

Comments
 (0)