From a25dd8064ed7329dd5924bce18b2a04d0b2843e8 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 3 Apr 2023 05:42:34 -0400 Subject: [PATCH] test/fuzzers: fuzz rlp handling of big.Int and uint256.Int (#26917) test/fuzzers: fuzz rlp handling of big.Lnt and uint256.Int --- tests/fuzzers/rlp/rlp_fuzzer.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/fuzzers/rlp/rlp_fuzzer.go b/tests/fuzzers/rlp/rlp_fuzzer.go index ac02e1651..9fcdb5776 100644 --- a/tests/fuzzers/rlp/rlp_fuzzer.go +++ b/tests/fuzzers/rlp/rlp_fuzzer.go @@ -19,9 +19,11 @@ package rlp import ( "bytes" "fmt" + "math/big" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" + "github.com/holiman/uint256" ) func decodeEncode(input []byte, val interface{}, i int) { @@ -126,5 +128,16 @@ func Fuzz(input []byte) int { var rs types.Receipts decodeEncode(input, &rs, i) } + { + i++ + var v struct { + AnIntPtr *big.Int + AnInt big.Int + AnU256Ptr *uint256.Int + AnU256 uint256.Int + NotAnU256 [4]uint64 + } + decodeEncode(input, &v, i) + } return 1 }