From ec0949c18e63ebcea8c3aa26c51d30857547797e Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 6 Aug 2020 12:52:21 +0700 Subject: [PATCH] remove the gofuzz build flag --- .gitignore | 1 + fuzzing/frames/{main.go => cmd/corpus.go} | 2 -- fuzzing/frames/fuzz.go | 7 +++---- fuzzing/header/{main.go => cmd/corpus.go} | 2 -- fuzzing/header/fuzz.go | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) rename fuzzing/frames/{main.go => cmd/corpus.go} (99%) rename fuzzing/header/{main.go => cmd/corpus.go} (99%) diff --git a/.gitignore b/.gitignore index 86317213..8cccd348 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ fuzzing/*/crashers fuzzing/*/sonarprofile fuzzing/*/suppressions fuzzing/*/corpus/ +fuzzing/*-fuzz.zip !fuzzing/frames/single-frame* !fuzzing/frames/multiple-frame* !fuzzing/header/header* diff --git a/fuzzing/frames/main.go b/fuzzing/frames/cmd/corpus.go similarity index 99% rename from fuzzing/frames/main.go rename to fuzzing/frames/cmd/corpus.go index c81bf0f4..6043a2ab 100644 --- a/fuzzing/frames/main.go +++ b/fuzzing/frames/cmd/corpus.go @@ -1,5 +1,3 @@ -// +build !gofuzz - package main import ( diff --git a/fuzzing/frames/fuzz.go b/fuzzing/frames/fuzz.go index 45f7d8df..1d5110ce 100644 --- a/fuzzing/frames/fuzz.go +++ b/fuzzing/frames/fuzz.go @@ -1,5 +1,3 @@ -// +build gofuzz - package frames import ( @@ -10,9 +8,10 @@ import ( "github.com/lucas-clemente/quic-go/internal/wire" ) -const version = protocol.VersionTLS - +//go:generate go run ./cmd/corpus.go func Fuzz(data []byte) int { + const version = protocol.VersionTLS + if len(data) < 1 { return 0 } diff --git a/fuzzing/header/main.go b/fuzzing/header/cmd/corpus.go similarity index 99% rename from fuzzing/header/main.go rename to fuzzing/header/cmd/corpus.go index 13dff303..6e3f1cd5 100644 --- a/fuzzing/header/main.go +++ b/fuzzing/header/cmd/corpus.go @@ -1,5 +1,3 @@ -// +build !gofuzz - package main import ( diff --git a/fuzzing/header/fuzz.go b/fuzzing/header/fuzz.go index c421c847..328d35c0 100644 --- a/fuzzing/header/fuzz.go +++ b/fuzzing/header/fuzz.go @@ -1,5 +1,3 @@ -// +build gofuzz - package header import ( @@ -12,6 +10,7 @@ import ( const version = protocol.VersionTLS +//go:generate go run ./cmd/corpus.go func Fuzz(data []byte) int { if len(data) < 1 { return 0