Skip to content

Commit c78721d

Browse files
committed
Merge branch 'patch-3' into 'master'
fix: Correct flash boundary check for read/verify operations Closes ESF-246, ESF-247, and ESF-248 See merge request espressif/esp-serial-flasher!168
2 parents 5edd10d + bdf7b62 commit c78721d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/esp_loader.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ static esp_loader_error_t flash_read_stub(uint8_t *dest, uint32_t address, uint3
609609
esp_loader_error_t esp_loader_flash_read(uint8_t *dest, uint32_t address, uint32_t length)
610610
{
611611
RETURN_ON_ERROR(init_flash_params());
612-
if (address + length >= s_target_flash_size) {
612+
if (address + length > s_target_flash_size) {
613613
return ESP_LOADER_ERROR_IMAGE_SIZE;
614614
}
615615

@@ -810,7 +810,7 @@ esp_loader_error_t esp_loader_flash_verify_known_md5(uint32_t address,
810810

811811
RETURN_ON_ERROR(init_flash_params());
812812

813-
if (address + size >= s_target_flash_size) {
813+
if (address + size > s_target_flash_size) {
814814
return ESP_LOADER_ERROR_IMAGE_SIZE;
815815
}
816816

0 commit comments

Comments
 (0)