oss-fuzz: fix remaining errors

This commit is contained in:
Marius van der Wijden 2023-10-16 15:26:07 +02:00
parent 69d3d5cd42
commit 51908e210d
4 changed files with 9 additions and 6 deletions

View file

@ -1,13 +1,10 @@
//go:build gofuzz
// +build gofuzz
package blake2b package blake2b
import ( import (
"encoding/binary" "encoding/binary"
) )
func Fuzz(data []byte) int { func fuzz(data []byte) int {
// Make sure the data confirms to the input model // Make sure the data confirms to the input model
if len(data) != 211 { if len(data) != 211 {
return 0 return 0

View file

@ -6,6 +6,12 @@ import (
"testing" "testing"
) )
func Fuzz(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
fuzz(data)
})
}
func TestF(t *testing.T) { func TestF(t *testing.T) {
for i, test := range testVectorsF { for i, test := range testVectorsF {
t.Run(fmt.Sprintf("test vector %v", i), func(t *testing.T) { t.Run(fmt.Sprintf("test vector %v", i), func(t *testing.T) {

View file

@ -62,7 +62,7 @@ compile_fuzzer tests/fuzzers/bn256 FuzzMul fuzzBn256Mul
compile_fuzzer tests/fuzzers/bn256 FuzzPair fuzzBn256Pair compile_fuzzer tests/fuzzers/bn256 FuzzPair fuzzBn256Pair
compile_fuzzer tests/fuzzers/runtime Fuzz fuzzVmRuntime compile_fuzzer tests/fuzzers/runtime Fuzz fuzzVmRuntime
compile_fuzzer tests/fuzzers/keystore Fuzz fuzzKeystore compile_fuzzer tests/fuzzers/keystore Fuzz fuzzKeystore
compile_fuzzer tests/fuzzers/txfetcher FuzzFetcher fuzzTxfetcher compile_fuzzer tests/fuzzers/txfetcher Fuzz fuzzTxfetcher
compile_fuzzer tests/fuzzers/rlp Fuzz fuzzRlp compile_fuzzer tests/fuzzers/rlp Fuzz fuzzRlp
compile_fuzzer tests/fuzzers/trie Fuzz fuzzTrie compile_fuzzer tests/fuzzers/trie Fuzz fuzzTrie
compile_fuzzer tests/fuzzers/stacktrie Fuzz fuzzStackTrie compile_fuzzer tests/fuzzers/stacktrie Fuzz fuzzStackTrie

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package trie package txfetcher
import "testing" import "testing"