mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/encrypted_flash_write_safe_addr_v5.2' into 'release/v5.2'
fix(spi_flash): check for safe write address in encrypted flash API (v5.2) See merge request espressif/esp-idf!29204
This commit is contained in:
commit
00f130621f
@ -1131,11 +1131,13 @@ esp_err_t IRAM_ATTR esp_flash_write_encrypted(esp_flash_t *chip, uint32_t addres
|
||||
#endif //CONFIG_SPI_FLASH_VERIFY_WRITE
|
||||
|
||||
esp_err_t err = rom_spiflash_api_funcs->chip_check(&chip);
|
||||
VERIFY_CHIP_OP(write);
|
||||
// Flash encryption only support on main flash.
|
||||
if (chip != esp_flash_default_chip) {
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
if (err != ESP_OK) return err;
|
||||
CHECK_WRITE_ADDRESS(chip, address, length);
|
||||
|
||||
if (buffer == NULL || address + length > chip->size) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user