Skip to content

Commit

Permalink
Fix off-by-one-error in RoT caboose reading (#1436)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter authored Jun 27, 2023
1 parent 31dac53 commit ec0b7fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drv/lpc55-update-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl idl::InOrderUpdateImpl for ServerImpl<'_> {
data: Leased<idol_runtime::W, [u8]>,
) -> Result<(), RequestError<RawCabooseError>> {
let caboose = caboose_slice(&self.flash, slot)?;
if offset as usize + data.len() >= caboose.len() {
if offset as usize + data.len() > caboose.len() {
return Err(RawCabooseError::InvalidRead.into());
}
copy_from_caboose_chunk(
Expand Down

0 comments on commit ec0b7fe

Please sign in to comment.