mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Various improvements to fuzzer SAPIs
This commit is contained in:
parent
41f45647f9
commit
c4e2ca607f
25 changed files with 322 additions and 102 deletions
|
@ -41,8 +41,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||
memcpy(data, Data, Size);
|
||||
data[Size] = '\0';
|
||||
|
||||
if (php_request_startup()==FAILURE) {
|
||||
php_module_shutdown();
|
||||
if (fuzzer_request_startup() == FAILURE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -50,9 +49,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||
zval result;
|
||||
php_json_parser parser;
|
||||
php_json_parser_init(&parser, &result, data, Size, option, 10);
|
||||
php_json_yyparse(&parser);
|
||||
|
||||
ZVAL_UNDEF(&result);
|
||||
if (php_json_yyparse(&parser) == SUCCESS) {
|
||||
zval_ptr_dtor(&result);
|
||||
}
|
||||
}
|
||||
|
||||
php_request_shutdown(NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue