mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
Merge branch 'bugfix/esp-partition-erase-size-zero-check' into 'master'
fix(esp_partition): guard linux erase_range against zero erase_size Closes IDF-6143 See merge request espressif/esp-idf!51681
This commit is contained in:
@@ -648,6 +648,9 @@ esp_err_t esp_partition_write_raw(const esp_partition_t *partition, size_t dst_o
|
||||
esp_err_t esp_partition_erase_range(const esp_partition_t *partition, size_t offset, size_t size)
|
||||
{
|
||||
assert(partition != NULL && s_spiflash_mem_file_buf != NULL);
|
||||
if (partition->erase_size == 0) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (partition->readonly) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
|
||||
Reference in New Issue
Block a user