Skip to content

Commit

Permalink
add: num_signatures == 0 check from SIMD-0152
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRigel committed Oct 13, 2024
1 parent 226eeef commit 0f4876e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdk/src/ed25519_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ pub fn verify(
return Err(PrecompileError::InvalidInstructionDataSize);
}
let num_signatures = data[0] as usize;
if num_signatures == 0 {
return Err(PrecompileError::InvalidInstructionDataSize);
}
if num_signatures == 0 && data.len() > SIGNATURE_OFFSETS_START {
return Err(PrecompileError::InvalidInstructionDataSize);
}
Expand Down

0 comments on commit 0f4876e

Please sign in to comment.