From 061586aea9912c430c2fc120887ac9d0d19c1928 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Mon, 30 Nov 2020 13:14:32 +1100 Subject: [PATCH] Update mtail fuzzing to use compile_go_fuzzer. (#4744) --- projects/mtail/Dockerfile | 5 ++--- projects/mtail/build.sh | 12 +++--------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/projects/mtail/Dockerfile b/projects/mtail/Dockerfile index 3f2c070ff..7861cbcd5 100644 --- a/projects/mtail/Dockerfile +++ b/projects/mtail/Dockerfile @@ -15,7 +15,6 @@ ################################################################################ FROM gcr.io/oss-fuzz-base/base-builder -RUN mkdir -p github.com/google -RUN git clone --depth 1 https://github.com/google/mtail github.com/google/mtail -WORKDIR github.com/google/mtail +RUN git clone --depth 1 https://github.com/google/mtail $GOPATH/src/github.com/google/mtail +WORKDIR $GOPATH/src/github.com/google/mtail COPY build.sh $SRC/ diff --git a/projects/mtail/build.sh b/projects/mtail/build.sh index 58c6cf7f3..2c769ad33 100755 --- a/projects/mtail/build.sh +++ b/projects/mtail/build.sh @@ -15,12 +15,6 @@ # ################################################################################ -# We've used git checkout, not go get to fetch the source so set up the GOPATH to find our source. -export GOPATH=$GOPATH:/ - -# go-fuzz-build doesn't like modules until https://github.com/dvyukov/go-fuzz/issues/195 is fixed -# fetch and vendor all the dependencies so go-fuzz-build can find them -make GO111MODULE=off --debug install_deps -go mod vendor - -make GO111MODULE=off --debug $OUT/vm-fuzzer.dict $OUT/vm-fuzzer_seed_corpus.zip $OUT/vm-fuzzer +compile_go_fuzzer github.com/google/mtail/internal/vm Fuzz vm-fuzzer +# Make the dictionary and seed corpus. +make --debug $OUT/vm-fuzzer.dict $OUT/vm-fuzzer_seed_corpus.zip