Unverified Commit a25dd806 authored by Martin Holst Swende's avatar Martin Holst Swende Committed by GitHub

test/fuzzers: fuzz rlp handling of big.Int and uint256.Int (#26917)

test/fuzzers: fuzz rlp handling of big.Lnt and uint256.Int
parent 94457cce
...@@ -19,9 +19,11 @@ package rlp ...@@ -19,9 +19,11 @@ package rlp
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"math/big"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
"github.com/holiman/uint256"
) )
func decodeEncode(input []byte, val interface{}, i int) { func decodeEncode(input []byte, val interface{}, i int) {
...@@ -126,5 +128,16 @@ func Fuzz(input []byte) int { ...@@ -126,5 +128,16 @@ func Fuzz(input []byte) int {
var rs types.Receipts var rs types.Receipts
decodeEncode(input, &rs, i) 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 return 1
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment