Skip to content

Commit

Permalink
test/fuzzers: fuzz rlp handling of big.Int and uint256.Int (ethereum#…
Browse files Browse the repository at this point in the history
…26917)

test/fuzzers: fuzz rlp handling of big.Lnt and uint256.Int
  • Loading branch information
holiman authored and mmsqe committed Dec 7, 2023
1 parent c7d319d commit a6459f0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/fuzzers/rlp/rlp_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}

0 comments on commit a6459f0

Please sign in to comment.