From 739428a3320b8459b209e75efc864400692f3da5 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Tue, 20 Oct 2020 17:38:23 +0800 Subject: [PATCH] Fix signature index check in secp256k1 verify --- sdk/src/secp256k1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/src/secp256k1.rs b/sdk/src/secp256k1.rs index 4a62f5897c3f10..7ec450c947698d 100644 --- a/sdk/src/secp256k1.rs +++ b/sdk/src/secp256k1.rs @@ -72,7 +72,7 @@ pub fn verify_eth_addresses( // Parse out signature let signature_index = offsets.signature_instruction_index as usize; - if signature_index > instruction_datas.len() { + if signature_index >= instruction_datas.len() { return Err(Secp256k1Error::InvalidInstructionDataSize); } let signature_instruction = instruction_datas[signature_index];