Skip to content

Commit 7562679

Browse files
committed
Remove json checks in fuzzer SAPI
JSON is now always enabled
1 parent 7aa8c7e commit 7562679

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

sapi/fuzzer/config.m4

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ if test "$PHP_FUZZER" != "no"; then
7676

7777
PHP_FUZZER_TARGET([parser], PHP_FUZZER_PARSER_OBJS)
7878
PHP_FUZZER_TARGET([unserialize], PHP_FUZZER_UNSERIALIZE_OBJS)
79+
PHP_FUZZER_TARGET([json], PHP_FUZZER_JSON_OBJS)
7980

80-
dnl json extension is enabled by default
81-
if (test -n "$enable_json" && test "$enable_json" != "no") || test -z "$PHP_ENABLE_ALL"; then
82-
PHP_FUZZER_TARGET([json], PHP_FUZZER_JSON_OBJS)
83-
fi
8481
if test -n "$enable_exif" && test "$enable_exif" != "no"; then
8582
PHP_FUZZER_TARGET([exif], PHP_FUZZER_EXIF_OBJS)
8683
fi

sapi/fuzzer/fuzzer-json.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,9 @@
2828
#include <stdlib.h>
2929

3030
#include "fuzzer-sapi.h"
31-
32-
#ifdef HAVE_JSON
3331
#include "ext/json/php_json_parser.h"
34-
#endif
3532

3633
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
37-
#ifdef HAVE_JSON
3834
char *data = malloc(Size+1);
3935
memcpy(data, Data, Size);
4036
data[Size] = '\0';
@@ -55,10 +51,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
5551
php_request_shutdown(NULL);
5652

5753
free(data);
58-
#else
59-
fprintf(stderr, "\n\nERROR:\nPHP built without JSON, recompile with --enable-json to use this fuzzer\n");
60-
exit(1);
61-
#endif
6254
return 0;
6355
}
6456

0 commit comments

Comments
 (0)