Skip to content

Commit

Permalink
signal corruption if out of bounds chunk length
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Apr 29, 2024
1 parent 6fdd0dc commit 620c183
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ impl PageReader {

async fn load_chunk<F: Flash>(&mut self, flash: &mut F) -> Result<(), Error<F::Error>> {
let n = align_up(self.ch.chunk_len);
if n > MAX_CHUNK_SIZE {
return Err(Error::Corrupted);
}
flash
.read(
self.ch.page_id as _,
Expand Down

0 comments on commit 620c183

Please sign in to comment.