Skip to content

Commit 41f4564

Browse files
smalyshevnikic
authored andcommitted
Add fuzzer SAPIs to the core
1 parent 9b9fac7 commit 41f4564

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+936
-0
lines changed

sapi/fuzzer/Makefile.frag

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
fuzzer: $(PHP_FUZZER_BINARIES)
2+
3+
FUZZER_BUILD = $(LIBTOOL) --mode=link $(FUZZING_CC) -export-dynamic $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) $(FUZZING_LIB) -rpath /ORIGIN/lib
4+
5+
$(SAPI_FUZZER_PATH)/php-fuzz-parser: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(PHP_FUZZER_PARSER_OBJS)
6+
$(FUZZER_BUILD) $(PHP_FUZZER_PARSER_OBJS) -o $@
7+
8+
$(SAPI_FUZZER_PATH)/php-fuzz-unserialize: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(PHP_FUZZER_UNSERIALIZE_OBJS)
9+
$(FUZZER_BUILD) $(PHP_FUZZER_UNSERIALIZE_OBJS) -o $@
10+
11+
$(SAPI_FUZZER_PATH)/php-fuzz-json: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(PHP_FUZZER_JSON_OBJS)
12+
$(FUZZER_BUILD) $(PHP_FUZZER_JSON_OBJS) -o $@
13+
14+
$(SAPI_FUZZER_PATH)/php-fuzz-exif: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(PHP_FUZZER_EXIF_OBJS)
15+
$(FUZZER_BUILD) $(PHP_FUZZER_EXIF_OBJS) -o $@
16+
17+
$(SAPI_FUZZER_PATH)/php-fuzz-mbstring: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(PHP_FUZZER_MBSTRING_OBJS)
18+
$(FUZZER_BUILD) $(PHP_FUZZER_MBSTRING_OBJS) -o $@

sapi/fuzzer/README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Fuzzing SAPI for PHP
2+
3+
Enable fuzzing targets with --enable-fuzzer switch.
4+
5+
Your compiler should support -fsanitize=address and you need
6+
to have Fuzzer library around.
7+
8+
When running `make` it creates these binaries in `sapi/fuzzer/`:
9+
* php-fuzz-parser - fuzzing language parser
10+
* php-fuzz-unserialize - fuzzing unserialize() function
11+
* php-fuzz-json - fuzzing JSON parser
12+
* php-fuzz-exif - fuzzing exif_read_data() function (use --enable-exif)
13+
* php-fuzz-mbstring - fuzzing mb_ereg[i] (requires --enable-mbstring)

sapi/fuzzer/config.m4

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
AC_MSG_CHECKING(for clang fuzzer SAPI)
2+
3+
PHP_ARG_ENABLE([fuzzer],,
4+
[AS_HELP_STRING([--enable-fuzzer],
5+
[Build PHP as clang fuzzing test module (for developers)])],
6+
[no])
7+
8+
dnl For newer clang versions see https://llvm.org/docs/LibFuzzer.html#fuzzer-usage
9+
dnl for relevant flags.
10+
11+
dnl Macro to define fuzzing target
12+
dnl PHP_FUZZER_TARGET(name, target-var)
13+
dnl
14+
AC_DEFUN([PHP_FUZZER_TARGET], [
15+
PHP_FUZZER_BINARIES="$PHP_FUZZER_BINARIES $SAPI_FUZZER_PATH/php-fuzz-$1"
16+
PHP_SUBST($2)
17+
PHP_ADD_SOURCES_X([sapi/fuzzer],[fuzzer-$1.c fuzzer-sapi.c],[],$2)
18+
])
19+
20+
if test "$PHP_FUZZER" != "no"; then
21+
AC_MSG_RESULT([yes])
22+
PHP_REQUIRE_CXX()
23+
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/fuzzer/Makefile.frag)
24+
SAPI_FUZZER_PATH=sapi/fuzzer
25+
PHP_SUBST(SAPI_FUZZER_PATH)
26+
if test -z "$LIB_FUZZING_ENGINE"; then
27+
FUZZING_LIB="-lFuzzer"
28+
FUZZING_CC="$CC"
29+
AX_CHECK_COMPILE_FLAG([-fsanitize=address], [
30+
CFLAGS="$CFLAGS -fsanitize=address"
31+
CXXFLAGS="$CXXFLAGS -fsanitize=address"
32+
LDFLAGS="$LDFLAGS -fsanitize=address"
33+
],[
34+
AC_MSG_ERROR(compiler doesn't support -fsanitize flags)
35+
])
36+
else
37+
FUZZING_LIB="-lFuzzingEngine"
38+
FUZZING_CC="$CXX -stdlib=libc++"
39+
fi
40+
PHP_SUBST(FUZZING_LIB)
41+
PHP_SUBST(FUZZING_CC)
42+
43+
dnl PHP_SELECT_SAPI(fuzzer-parser, program, $FUZZER_SOURCES, , '$(SAPI_FUZZER_PATH)')
44+
45+
PHP_ADD_BUILD_DIR([sapi/fuzzer])
46+
PHP_FUZZER_BINARIES=""
47+
PHP_INSTALLED_SAPIS="$PHP_INSTALLED_SAPIS fuzzer"
48+
49+
PHP_FUZZER_TARGET([parser], PHP_FUZZER_PARSER_OBJS)
50+
PHP_FUZZER_TARGET([unserialize], PHP_FUZZER_UNSERIALIZE_OBJS)
51+
PHP_FUZZER_TARGET([exif], PHP_FUZZER_EXIF_OBJS)
52+
53+
if test -n "$enable_json" && test "$enable_json" != "no"; then
54+
PHP_FUZZER_TARGET([json], PHP_FUZZER_JSON_OBJS)
55+
fi
56+
if test -n "$enable_mbstring" && test "$enable_mbstring" != "no"; then
57+
PHP_FUZZER_TARGET([mbstring], PHP_FUZZER_MBSTRING_OBJS)
58+
fi
59+
60+
PHP_SUBST(PHP_FUZZER_BINARIES)
61+
fi
62+
63+
AC_MSG_RESULT($PHP_FUZZER)

sapi/fuzzer/corpus/exif/bug34704.jpg

9.74 KB
9.74 KB

sapi/fuzzer/corpus/exif/bug48378.jpeg

2.51 KB
85.5 KB
85.5 KB
Lines changed: 9 additions & 0 deletions
Lines changed: 12 additions & 0 deletions

sapi/fuzzer/corpus/exif/bug68113.jpg

368 Bytes
368 Bytes

sapi/fuzzer/corpus/exif/bug68799.jpg

735 Bytes
140 Bytes
140 Bytes
112 Bytes
32 Bytes

sapi/fuzzer/corpus/exif/bug72603.jpeg

3.62 KB

sapi/fuzzer/corpus/exif/bug72618.jpg

3.62 KB

sapi/fuzzer/corpus/exif/bug72627.tiff

1.22 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/bug73737.tiff

48 Bytes
Binary file not shown.
3.32 KB
1.59 KB

sapi/fuzzer/corpus/exif/bug76423.jpg

1.5 KB

sapi/fuzzer/corpus/exif/bug76557.jpg

2.32 KB

sapi/fuzzer/corpus/exif/bug77540.jpg

91 Bytes

sapi/fuzzer/corpus/exif/bug77563.jpg

63 Bytes

sapi/fuzzer/corpus/exif/bug77753.tiff

873 Bytes
Binary file not shown.

sapi/fuzzer/corpus/exif/bug77831.tiff

49 Bytes
Binary file not shown.

sapi/fuzzer/corpus/exif/bug77950.tiff

1.24 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/bug77988.jpg

1.17 KB
7.42 KB

sapi/fuzzer/corpus/exif/image007.jpg

283 Bytes

sapi/fuzzer/corpus/exif/image008.jpg

527 Bytes

sapi/fuzzer/corpus/exif/image009.jpg

527 Bytes

sapi/fuzzer/corpus/exif/image010.jpg

741 Bytes

sapi/fuzzer/corpus/exif/image011.jpg

741 Bytes

sapi/fuzzer/corpus/exif/image012.jpg

721 Bytes

sapi/fuzzer/corpus/exif/image013.jpg

721 Bytes

sapi/fuzzer/corpus/exif/image014.jpg

935 Bytes

sapi/fuzzer/corpus/exif/image015.jpg

935 Bytes

sapi/fuzzer/corpus/exif/image016.tiff

1.83 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image017.tiff

1.83 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image018.tiff

2.04 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image020.tiff

2.02 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image021.tiff

2.02 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image022.tiff

2.23 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image023.tiff

2.23 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image024.jpg

417 Bytes

sapi/fuzzer/corpus/exif/image025.jpg

417 Bytes

sapi/fuzzer/corpus/exif/image026.tiff

1.94 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/image027.tiff

1.94 KB
Binary file not shown.

sapi/fuzzer/corpus/exif/test1.jpg

523 Bytes

sapi/fuzzer/corpus/exif/test2.jpg

1.21 KB

sapi/fuzzer/corpus/exif/test22.jpg

1.21 KB

sapi/fuzzer/corpus/exif/test3.jpg

1.21 KB

sapi/fuzzer/corpus/exif/test4.jpg

713 Bytes

sapi/fuzzer/corpus/exif/test5.jpg

603 Bytes

sapi/fuzzer/corpus/exif/test6.jpg

1.21 KB

sapi/fuzzer/corpus/json/1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"prop":{"prop":null}}

sapi/fuzzer/corpus/json/10.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"a":100.1,"b":"foo"}

sapi/fuzzer/corpus/json/11.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[100.1,"bar"]

sapi/fuzzer/corpus/json/12.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{"0":0,"\u0000ab":1,"1":"\u0000null-prefixed value"}
2+

sapi/fuzzer/corpus/json/13.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "test": { "foo": "bar" } }

sapi/fuzzer/corpus/json/14.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"aa\udbff\udffdzz"
2+

sapi/fuzzer/corpus/json/15.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"latin 1234 -\/ russian мама мыла раму specialchars \u0002 \b \n U+1D11E >𝄞<"

sapi/fuzzer/corpus/json/16.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"test":"123343e871700"}

sapi/fuzzer/corpus/json/17.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

sapi/fuzzer/corpus/json/18.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"myInt":99,"myFloat":123.45,"myNull":null,"myBool":true,"myString":"Hello World"}

sapi/fuzzer/corpus/json/19.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u3067\u3059\u300201234\uff15\uff16\uff17\uff18\uff19\u3002"

sapi/fuzzer/corpus/json/2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"largenum":123456789012345678901234567890}

sapi/fuzzer/corpus/json/3.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["<foo>","'bar'","\"baz\"","&blong&"]

sapi/fuzzer/corpus/json/4.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["\u003Cfoo\u003E","\u0027bar\u0027","\u0022baz\u0022","\u0026blong\u0026"]

sapi/fuzzer/corpus/json/5.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
{"":"value"},
3+
{"":"value", "key":"value"},
4+
{"key":"value", "":"value"}
5+
]

sapi/fuzzer/corpus/json/6.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[123,13452345,123.13452345]

sapi/fuzzer/corpus/json/7.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
["\ud834\udd00"]
2+

sapi/fuzzer/corpus/json/8.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"zero": 0e0}

sapi/fuzzer/corpus/json/9.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[null,null,"abc"]

sapi/fuzzer/corpus/json/fail1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"A JSON payload should be an object or array, not a string."

sapi/fuzzer/corpus/json/fail10.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Extra value after close": true} "misplaced quoted value"

sapi/fuzzer/corpus/json/fail11.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Illegal expression": 1 + 2}

sapi/fuzzer/corpus/json/fail12.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Illegal invocation": alert()}

sapi/fuzzer/corpus/json/fail13.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Numbers cannot have leading zeroes": 013}

sapi/fuzzer/corpus/json/fail14.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Numbers cannot be hex": 0x14}

sapi/fuzzer/corpus/json/fail15.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Illegal backslash escape: \x15"]

sapi/fuzzer/corpus/json/fail16.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[\naked]

sapi/fuzzer/corpus/json/fail17.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Illegal backslash escape: \017"]

sapi/fuzzer/corpus/json/fail18.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]

sapi/fuzzer/corpus/json/fail19.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Missing colon" null}

sapi/fuzzer/corpus/json/fail2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Unclosed array"

sapi/fuzzer/corpus/json/fail20.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Double colon":: null}

sapi/fuzzer/corpus/json/fail21.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Comma instead of colon", null}

sapi/fuzzer/corpus/json/fail22.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Colon instead of comma": false]

sapi/fuzzer/corpus/json/fail23.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Bad value", truth]

sapi/fuzzer/corpus/json/fail24.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
['single quote']

sapi/fuzzer/corpus/json/fail25.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[" tab character in string "]

sapi/fuzzer/corpus/json/fail26.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["tab\ character\ in\ string\ "]

sapi/fuzzer/corpus/json/fail27.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
["line
2+
break"]

sapi/fuzzer/corpus/json/fail28.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
["line\
2+
break"]

sapi/fuzzer/corpus/json/fail29.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[0e]

sapi/fuzzer/corpus/json/fail3.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{unquoted_key: "keys must be quoted"}

sapi/fuzzer/corpus/json/fail30.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[0e+]

sapi/fuzzer/corpus/json/fail31.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[0e+-1]

sapi/fuzzer/corpus/json/fail32.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Comma instead if closing brace": true,

sapi/fuzzer/corpus/json/fail33.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["mismatch"}

sapi/fuzzer/corpus/json/fail4.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["extra comma",]

sapi/fuzzer/corpus/json/fail5.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["double extra comma",,]

sapi/fuzzer/corpus/json/fail6.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ , "<-- missing value"]

sapi/fuzzer/corpus/json/fail7.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Comma after the close"],

sapi/fuzzer/corpus/json/fail8.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Extra close"]]

sapi/fuzzer/corpus/json/fail9.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"Extra comma": true,}

sapi/fuzzer/corpus/json/pass1.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
"JSON Test Pattern pass1",
3+
{"object with 1 member":["array with 1 element"]},
4+
{},
5+
[],
6+
-42,
7+
true,
8+
false,
9+
null,
10+
{
11+
"integer": 1234567890,
12+
"real": -9876.543210,
13+
"e": 0.123456789e-12,
14+
"E": 1.234567890E+34,
15+
"": 23456789012E66,
16+
"zero": 0,
17+
"one": 1,
18+
"space": " ",
19+
"quote": "\"",
20+
"backslash": "\\",
21+
"controls": "\b\f\n\r\t",
22+
"slash": "/ & \/",
23+
"alpha": "abcdefghijklmnopqrstuvwyz",
24+
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
25+
"digit": "0123456789",
26+
"0123456789": "digit",
27+
"special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
28+
"hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
29+
"true": true,
30+
"false": false,
31+
"null": null,
32+
"array":[ ],
33+
"object":{ },
34+
"address": "50 St. James Street",
35+
"url": "http://www.JSON.org/",
36+
"comment": "// /* <!-- --",
37+
"# -- --> */": " ",
38+
" s p a c e d " :[1,2 , 3
39+
40+
,
41+
42+
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
43+
"jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
44+
"quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
45+
"\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
46+
: "A key can be any string"
47+
},
48+
0.5 ,98.6
49+
,
50+
99.44
51+
,
52+
53+
1066,
54+
1e1,
55+
0.1e1,
56+
1e-1,
57+
1e00,2e+00,2e-00
58+
,"rosebud"]

sapi/fuzzer/corpus/json/pass2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]

sapi/fuzzer/corpus/json/pass3.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"JSON Test Pattern pass3": {
3+
"The outermost value": "must be an object or array.",
4+
"In this test": "It is an object."
5+
}
6+
}

0 commit comments

Comments
 (0)