Skip to content

Commit 1e27d83

Browse files
committed
Fix array index out of bounds: add max payload size check in iridium_sbd.rs
1 parent 7048c29 commit 1e27d83

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/iridium_sbd.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ impl IridiumSBDMessage {
3434
return None;
3535
}
3636

37+
// Check if length exceeds maximum payload size (340 bytes)
38+
if length > 340 {
39+
return None;
40+
}
41+
3742
let mut payload = [0u8; 340];
3843
payload[..length as usize].copy_from_slice(&data[3..3 + length as usize]);
3944

0 commit comments

Comments
 (0)