ngolo: fix build even when there is no corpus (#9932)

This should fix build of ngolo-fuzzing even when the corpus for one
target is empty.

net/http does not give a corpus because of `use of internal package
net/http/internal not allowed` in the tests...
This commit is contained in:
Catena cyber 2023-03-16 22:51:43 +01:00 committed by GitHub
parent 9df7263f34
commit 65b66c733c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -79,7 +79,7 @@ compile_package () {
popd
rm -rf $SRC/goroot/src/fuzz_ng_$pkg_flat/
cd fuzz_ng_$pkg_flat
zip -r $OUT/fuzz_ngo_"$pkg_flat"_seed_corpus.zip corpus
zip -r $OUT/fuzz_ngo_"$pkg_flat"_seed_corpus.zip corpus || true
)
}
@ -91,6 +91,7 @@ cd go114-fuzz-build
go build
)
touch $SRC/ok.txt $SRC/ko.txt
find $SRC/goroot/src/ -type d | cut -d/ -f5- | while read pkg; do
if [[ `ls $SRC/goroot/src/$pkg/*.go | wc -l` == '0' ]]; then
continue