mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
triedb/pathdb: fill more chars
This commit is contained in:
parent
e71031e02f
commit
26aa505581
1 changed files with 4 additions and 1 deletions
|
|
@ -694,7 +694,10 @@ func TestDecodeSingleCorruptedData(t *testing.T) {
|
||||||
// Test with corrupted varint in key section
|
// Test with corrupted varint in key section
|
||||||
corrupted := make([]byte, len(keySection))
|
corrupted := make([]byte, len(keySection))
|
||||||
copy(corrupted, keySection)
|
copy(corrupted, keySection)
|
||||||
corrupted[5] = 0xFF // Corrupt varint
|
// Fill first 10 bytes with 0xFF to create a varint overflow (>64 bits)
|
||||||
|
for i := range 10 {
|
||||||
|
corrupted[i] = 0xFF
|
||||||
|
}
|
||||||
_, err = decodeSingle(corrupted, nil)
|
_, err = decodeSingle(corrupted, nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("Expected error for corrupted varint")
|
t.Fatal("Expected error for corrupted varint")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue