From 26aa505581a5130116f8858e656a0d66d8872a2b Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 4 Nov 2025 18:00:53 +0800 Subject: [PATCH] triedb/pathdb: fill more chars --- triedb/pathdb/history_trienode_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/triedb/pathdb/history_trienode_test.go b/triedb/pathdb/history_trienode_test.go index d6b80f61f5..be4740a904 100644 --- a/triedb/pathdb/history_trienode_test.go +++ b/triedb/pathdb/history_trienode_test.go @@ -694,7 +694,10 @@ func TestDecodeSingleCorruptedData(t *testing.T) { // Test with corrupted varint in key section corrupted := make([]byte, len(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) if err == nil { t.Fatal("Expected error for corrupted varint")