mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'contrib/github_pr_18229' into 'master'
fix(bootloader): prevent unsigned overflow in partition table validation (GitHub PR) Closes IDFGH-17230 See merge request espressif/esp-idf!45839
This commit is contained in:
@@ -23,7 +23,7 @@ esp_err_t esp_partition_table_verify(const esp_partition_info_t *partition_table
|
||||
|
||||
if (part->magic == ESP_PARTITION_MAGIC) {
|
||||
const esp_partition_pos_t *pos = &part->pos;
|
||||
if (pos->offset > chip_size || pos->offset + pos->size > chip_size) {
|
||||
if (pos->offset > chip_size || pos->size > chip_size - pos->offset) {
|
||||
if (log_errors) {
|
||||
ESP_LOGE(TAG, "partition %d invalid - offset 0x%"PRIx32" size 0x%"PRIx32" exceeds flash chip size 0x%"PRIx32,
|
||||
num_parts, pos->offset, pos->size, chip_size);
|
||||
|
||||
Reference in New Issue
Block a user