Skip to content

Commit

Permalink
Don't check for end, just stop on first invalid type
Browse files Browse the repository at this point in the history
  • Loading branch information
ducalex committed Jul 21, 2024
1 parent 0a97f88 commit ec39ae0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion updater/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void app_main(void)
const esp_partition_info_t *part = &img->partitions[i];
if (part->magic == ESP_PARTITION_MAGIC)
{
if (part->type == PART_TYPE_END)
if (part->type != PART_TYPE_APP && part->type != PART_TYPE_DATA)
break;
// FIXME: label might not be nul-terminated, we should move it to a buffer and ensure it is
if (fseek(fp, part->pos.offset, SEEK_SET) == 0 && fread(partition_buffer, part->pos.size, 1, fp))
Expand Down

0 comments on commit ec39ae0

Please sign in to comment.