From 3d8de1a34ec5a5e25ce4509baaa7072218e880ae Mon Sep 17 00:00:00 2001 From: Olga Kunyavskaya Date: Tue, 7 Nov 2023 14:59:51 +0200 Subject: [PATCH] check key len --- contracts/near/eth-prover/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/near/eth-prover/src/lib.rs b/contracts/near/eth-prover/src/lib.rs index 79d22337..668664f5 100644 --- a/contracts/near/eth-prover/src/lib.rs +++ b/contracts/near/eth-prover/src/lib.rs @@ -336,7 +336,8 @@ impl EthProver { } } else { // Extension node - if path.as_slice() == &key[key_index..key_index + path.len()] { + if key_index + path.len() <= key.len() && + path.as_slice() == &key[key_index..key_index + path.len()] { let new_expected_root = get_vec(&node, 1); Self::_verify_trie_proof( new_expected_root,