Skip to content

Commit 26b9301

Browse files
authored
Merge pull request #217 from buger/fuzz-update
Update to use built-in fuzz function
2 parents 1239415 + 93ae43c commit 26b9301

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

oss-fuzz-build.sh

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,47 @@
11
#!/bin/bash -eu
22

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-
133
git clone https://github.com/dvyukov/go-fuzz-corpus
144
zip corpus.zip go-fuzz-corpus/json/corpus/*
155

166
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
188

199
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
2111

2212
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
2414

2515
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
2717

2818
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
3020

3121
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
3323

3424
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
3626

3727
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
3929

4030
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
4232

4333
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
4535

4636
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
4838

4939
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
5141

5242
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
5444

5545
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
5747

0 commit comments

Comments
 (0)