Skip to content

Commit 422aa6b

Browse files
committed
test/fuzzers: fuzz rlp handling of big.Lnt and uint256.Int
1 parent 58d0f64 commit 422aa6b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/fuzzers/rlp/rlp_fuzzer.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ package rlp
1919
import (
2020
"bytes"
2121
"fmt"
22+
"math/big"
2223

2324
"github.com/ethereum/go-ethereum/core/types"
2425
"github.com/ethereum/go-ethereum/rlp"
26+
"github.com/holiman/uint256"
2527
)
2628

2729
func decodeEncode(input []byte, val interface{}, i int) {
@@ -126,5 +128,16 @@ func Fuzz(input []byte) int {
126128
var rs types.Receipts
127129
decodeEncode(input, &rs, i)
128130
}
131+
{
132+
i++
133+
var v struct {
134+
AnIntPtr *big.Int
135+
AnInt big.Int
136+
AnU256Ptr *uint256.Int
137+
AnU256 uint256.Int
138+
NotAnU256 [4]uint64
139+
}
140+
decodeEncode(input, &v, i)
141+
}
129142
return 1
130143
}

0 commit comments

Comments
 (0)