test_ed25519 fails if we randomly select index 1 (#22779)

(cherry picked from commit c1b543c74d)

# Conflicts:
#       sdk/src/ed25519_instruction.rs

Co-authored-by: Sean Young <sean@mess.org>
This commit is contained in:
mergify[bot]
2022-01-27 13:02:42 +00:00
committed by GitHub
parent fdc1b046bc
commit 92cc75b3ae
2 changed files with 9 additions and 1 deletions

View File

@@ -108,6 +108,7 @@ pub fn verify_signatures(data: &[u8], instruction_datas: &[&[u8]]) -> Result<(),
let expected_data_size = num_signatures
.saturating_mul(SIGNATURE_OFFSETS_SERIALIZED_SIZE)
.saturating_add(SIGNATURE_OFFSETS_START);
// We do not check or use the byte at data[1]
if data.len() < expected_data_size {
return Err(Ed25519Error::InvalidInstructionDataSize);
}