Skip to content

Commit

Permalink
Fuzzit: use go-fuzz with go-modules support
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevgeny Pats committed Aug 31, 2019
1 parent 2737a62 commit 71334ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
fuzzit:
docker:
- image: fuzzitdev/fuzzit:golang1.12-stretch-llvm9
working_directory: /go/src/github.com/grpc-gateway/grpc-gateway
working_directory: /src/grpc-gateway
steps:
- checkout
- setup_remote_docker
Expand Down
19 changes: 8 additions & 11 deletions fuzzit.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/bash
set -xe

# Go-fuzz doesn't support modules yet, so ensure we do everything in the old style GOPATH way
export GO111MODULE="off"
# We use fuzzit fork until go-fuzz will support go-modules
mkdir -p /go/src/github.com/dvyukov
cd /go/src/github.com/dvyukov
git clone https://github.com/fuzzitdev/go-fuzz
cd go-fuzz
go get ./...
go build ./...

# Install go-fuzz
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build

# Compiling fuzz targets in fuzz.go with go-fuzz (https://github.com/dvyukov/go-fuzz) and libFuzzer support
# This is a workaround until go-fuzz has gomodules support https://github.com/dvyukov/go-fuzz/issues/195
BRANCH=$(git rev-parse --abbrev-ref HEAD)
git branch --set-upstream-to=origin/master $BRANCH

go get -v -u ./protoc-gen-grpc-gateway/httprule
#go get -v -u ./protoc-gen-grpc-gateway/httprule
go-fuzz-build -libfuzzer -o parse-http-rule.a ./protoc-gen-grpc-gateway/httprule
clang-9 -fsanitize=fuzzer parse-http-rule.a -o parse-http-rule

Expand Down

0 comments on commit 71334ad

Please sign in to comment.