diff --git a/.circleci/config.yml b/.circleci/config.yml index 373948713d4..1aa02799341 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,14 @@ jobs: - checkout - run: go get golang.org/x/lint/golint - run: make lint + fuzzit: + docker: + - image: fuzzitdev/golang:1.12.7-buster + working_directory: /go/src/github.com/grpc-gateway/grpc-gateway + steps: + - checkout + - setup_remote_docker + - run: ./fuzzit.sh bazel: docker: - image: l.gcr.io/google/bazel:latest @@ -88,6 +96,7 @@ workflows: jobs: - build - test + - fuzzit - node_test - generate - lint diff --git a/README.md b/README.md index 75dcd753620..bb1af895665 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # grpc-gateway -[![release](https://img.shields.io/github/release/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](https://github.com/grpc-ecosystem/grpc-gateway/releases) [![CircleCI](https://img.shields.io/circleci/project/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://circleci.com/gh/grpc-ecosystem/grpc-gateway) [![coverage](https://img.shields.io/codecov/c/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://codecov.io/gh/grpc-ecosystem/grpc-gateway) [![license](https://img.shields.io/github/license/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](LICENSE.txt) +[![release](https://img.shields.io/github/release/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](https://github.com/grpc-ecosystem/grpc-gateway/releases) [![CircleCI](https://img.shields.io/circleci/project/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://circleci.com/gh/grpc-ecosystem/grpc-gateway) [![fuzzit](https://app.fuzzit.dev/badge?org_id=grpc-gateway)](https://app.fuzzit.dev/orgs/grpc-gateway/dashboard) [![coverage](https://img.shields.io/codecov/c/github/grpc-ecosystem/grpc-gateway/master.svg?style=flat-square)](https://codecov.io/gh/grpc-ecosystem/grpc-gateway) [![license](https://img.shields.io/github/license/grpc-ecosystem/grpc-gateway.svg?style=flat-square)](LICENSE.txt) The grpc-gateway is a plugin of the Google protocol buffers compiler [protoc](https://github.com/protocolbuffers/protobuf). diff --git a/protoc-gen-grpc-gateway/httprule/fuzz.go b/protoc-gen-grpc-gateway/httprule/fuzz.go new file mode 100644 index 00000000000..138f7c12f0e --- /dev/null +++ b/protoc-gen-grpc-gateway/httprule/fuzz.go @@ -0,0 +1,11 @@ +// +build gofuzz + +package httprule + +func Fuzz(data []byte) int { + _, err := Parse(string(data)) + if err != nil { + return 0 + } + return 0 +}