Skip to content

Commit

Permalink
tests/fuzz/options: check input length
Browse files Browse the repository at this point in the history
  • Loading branch information
haasn committed Jul 29, 2024
1 parent 3a8d051 commit b8ea4da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tests/fuzz/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ int main()

while (__AFL_LOOP(100000)) {
size_t len = __AFL_FUZZ_TESTCASE_LEN;
if (!len)
continue;

buf[len - 1] = '\0'; // ensure proper null termination
pl_options_load(opts, (const char *) buf);
pl_options_save(opts);
Expand Down

0 comments on commit b8ea4da

Please sign in to comment.