Skip to content

Commit 0957573

Browse files
committed
Fix bound checking when erasing FlashRegion
Allow the exclusive address_to to be equal to the exclusive upper bound of a partition.
1 parent a5f929a commit 0957573

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

esp-bootloader-esp-idf/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- FlashRegion: The `capacity` methods implemented for `embedded_storage::ReadStorage` and `embedded_storage::nor_flash::ReadNorFlash` now return the same value (#3902)
2121
- Don't fail the build on long project names (#3905)
2222
- FlashRegion: Fix off-by-one bug when bounds checking (#3977)
23+
- FlashRegion: Fix exclusive upper bound checking when erasing (#4055)
2324

2425
### Removed
2526

esp-bootloader-esp-idf/src/partitions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ where
649649
return Err(Error::OutOfBounds);
650650
}
651651

652-
if !self.range().contains(&address_to) {
652+
if address_to > self.range().end {
653653
return Err(Error::OutOfBounds);
654654
}
655655

0 commit comments

Comments
 (0)