more p2p fuzzing, part 2 (#132)

This commit is contained in:
Alex Sharov 2021-10-26 14:29:18 +07:00 committed by GitHub
parent 8ab2970ce1
commit 750239d977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -97,7 +97,7 @@ func ParseGetPooledTransactions66(payload []byte, pos int, hashbuf []byte) (requ
}
hashes = common.EnsureEnoughSize(hashbuf, length.Hash*hashesCount)
for i := 0; pos < len(payload); i++ {
for i := 0; i < hashesCount; i++ {
pos, err = rlp.ParseHash(payload, pos, hashes[i*length.Hash:])
if err != nil {
return 0, hashes, 0, err
@ -114,7 +114,7 @@ func ParseGetPooledTransactions65(payload []byte, pos int, hashbuf []byte) (hash
}
hashes = common.EnsureEnoughSize(hashbuf, length.Hash*hashesCount)
for i := 0; pos < len(payload); i++ {
for i := 0; i < hashesCount; i++ {
pos, err = rlp.ParseHash(payload, pos, hashes[i*length.Hash:])
if err != nil {
return hashes, 0, err

View File

@ -0,0 +1,2 @@
go test fuzz v1
[]byte("\xe6\x83\x06\xf8T\xe1\xa0Y^'\xa85\xcdyr\x9f\x00\x80\xac\xec1\x87\xd4S_\xfc\xee\xee\xb6\xed\x14d\xa0N\xc7'\xaa\xca\xe1\xa0Y^'\xa85\xcdyr\x9f\x00\x80\xac\xec1\x87\xd4S_\xfc\xee\xeesN\xad\x96\xd8q\x8d\x03\xab\xc5\xfc\x13(")