From 5c50701b50b0707eb72e38abdc3e56c3d00fbf9a Mon Sep 17 00:00:00 2001 From: canepat <16927169+canepat@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:33:03 +0200 Subject: [PATCH] core: fix decoding account from E3 encoded storage --- silkworm/core/types/account.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/silkworm/core/types/account.cpp b/silkworm/core/types/account.cpp index 5f8dcf376f..ff757d3b00 100644 --- a/silkworm/core/types/account.cpp +++ b/silkworm/core/types/account.cpp @@ -192,6 +192,9 @@ tl::expected Account::from_encoded_storage_v3(ByteView e intx::unreachable(); } pos += len; + if (pos >= encoded_payload.length() && i < 3) { + return tl::unexpected{DecodingError::kInputTooShort}; + } } return a;