Skip to content

Commit

Permalink
Fix mbstring fuzzer
Browse files Browse the repository at this point in the history
mb_ereg can throw now, so we need a dummy frame and need to
free the exception afterwards.
  • Loading branch information
nikic committed Sep 11, 2020
1 parent cd05b56 commit 99a6877
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sapi/fuzzer/fuzzer-mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
return 0;
}

fuzzer_setup_dummy_frame();

args[0] = data;
args[1] = "test123";
fuzzer_call_php_func("mb_ereg", 2, args);
Expand All @@ -55,7 +57,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
args[1] = data;
fuzzer_call_php_func("mb_eregi", 2, args);

php_request_shutdown(NULL);
fuzzer_request_shutdown();

free(data);
#else
Expand Down

0 comments on commit 99a6877

Please sign in to comment.