|
1 | 1 | #!/bin/bash -eu
|
2 | 2 |
|
3 |
| -function compile_fuzzer { |
4 |
| - path=$1 |
5 |
| - function=$2 |
6 |
| - fuzzer=$3 |
7 |
| - |
8 |
| - go-fuzz -func $function -o $fuzzer.a $path |
9 |
| - |
10 |
| - $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer |
11 |
| -} |
12 |
| - |
13 | 3 | git clone https://github.com/dvyukov/go-fuzz-corpus
|
14 | 4 | zip corpus.zip go-fuzz-corpus/json/corpus/*
|
15 | 5 |
|
16 | 6 | cp corpus.zip $OUT/fuzzparsestring_seed_corpus.zip
|
17 |
| -compile_fuzzer github.com/buger/jsonparser FuzzParseString fuzzparsestring |
| 7 | +compile_go_fuzzer github.com/buger/jsonparser FuzzParseString fuzzparsestring |
18 | 8 |
|
19 | 9 | cp corpus.zip $OUT/fuzzeachkey_seed_corpus.zip
|
20 |
| -compile_fuzzer github.com/buger/jsonparser FuzzEachKey fuzzeachkey |
| 10 | +compile_go_fuzzer github.com/buger/jsonparser FuzzEachKey fuzzeachkey |
21 | 11 |
|
22 | 12 | cp corpus.zip $OUT/fuzzdelete_seed_corpus.zip
|
23 |
| -compile_fuzzer github.com/buger/jsonparser FuzzDelete fuzzdelete |
| 13 | +compile_go_fuzzer github.com/buger/jsonparser FuzzDelete fuzzdelete |
24 | 14 |
|
25 | 15 | cp corpus.zip $OUT/fuzzset_seed_corpus.zip
|
26 |
| -compile_fuzzer github.com/buger/jsonparser FuzzSet fuzzset |
| 16 | +compile_go_fuzzer github.com/buger/jsonparser FuzzSet fuzzset |
27 | 17 |
|
28 | 18 | cp corpus.zip $OUT/fuzzobjecteach_seed_corpus.zip
|
29 |
| -compile_fuzzer github.com/buger/jsonparser FuzzObjectEach fuzzobjecteach |
| 19 | +compile_go_fuzzer github.com/buger/jsonparser FuzzObjectEach fuzzobjecteach |
30 | 20 |
|
31 | 21 | cp corpus.zip $OUT/fuzzparsefloat_seed_corpus.zip
|
32 |
| -compile_fuzzer github.com/buger/jsonparser FuzzParseFloat fuzzparsefloat |
| 22 | +compile_go_fuzzer github.com/buger/jsonparser FuzzParseFloat fuzzparsefloat |
33 | 23 |
|
34 | 24 | cp corpus.zip $OUT/fuzzparseint_seed_corpus.zip
|
35 |
| -compile_fuzzer github.com/buger/jsonparser FuzzParseInt fuzzparseint |
| 25 | +compile_go_fuzzer github.com/buger/jsonparser FuzzParseInt fuzzparseint |
36 | 26 |
|
37 | 27 | cp corpus.zip $OUT/fuzzparsebool_seed_corpus.zip
|
38 |
| -compile_fuzzer github.com/buger/jsonparser FuzzParseBool fuzzparsebool |
| 28 | +compile_go_fuzzer github.com/buger/jsonparser FuzzParseBool fuzzparsebool |
39 | 29 |
|
40 | 30 | cp corpus.zip $OUT/fuzztokenstart_seed_corpus.zip
|
41 |
| -compile_fuzzer github.com/buger/jsonparser FuzzTokenStart fuzztokenstart |
| 31 | +compile_go_fuzzer github.com/buger/jsonparser FuzzTokenStart fuzztokenstart |
42 | 32 |
|
43 | 33 | cp corpus.zip $OUT/fuzzgetstring_seed_corpus.zip
|
44 |
| -compile_fuzzer github.com/buger/jsonparser FuzzGetString fuzzgetstring |
| 34 | +compile_go_fuzzer github.com/buger/jsonparser FuzzGetString fuzzgetstring |
45 | 35 |
|
46 | 36 | cp corpus.zip $OUT/fuzzgetfloat_seed_corpus.zip
|
47 |
| -compile_fuzzer github.com/buger/jsonparser FuzzGetFloat fuzzgetfloat |
| 37 | +compile_go_fuzzer github.com/buger/jsonparser FuzzGetFloat fuzzgetfloat |
48 | 38 |
|
49 | 39 | cp corpus.zip $OUT/fuzzgetint_seed_corpus.zip
|
50 |
| -compile_fuzzer github.com/buger/jsonparser FuzzGetInt fuzzgetint |
| 40 | +compile_go_fuzzer github.com/buger/jsonparser FuzzGetInt fuzzgetint |
51 | 41 |
|
52 | 42 | cp corpus.zip $OUT/fuzzgetboolean_seed_corpus.zip
|
53 |
| -compile_fuzzer github.com/buger/jsonparser FuzzGetBoolean fuzzgetboolean |
| 43 | +compile_go_fuzzer github.com/buger/jsonparser FuzzGetBoolean fuzzgetboolean |
54 | 44 |
|
55 | 45 | cp corpus.zip $OUT/fuzzgetunsafestring_seed_corpus.zip
|
56 |
| -compile_fuzzer github.com/buger/jsonparser FuzzGetUnsafeString fuzzgetunsafestring |
| 46 | +compile_go_fuzzer github.com/buger/jsonparser FuzzGetUnsafeString fuzzgetunsafestring |
57 | 47 |
|
0 commit comments