Skip to content

Commit b35f3b6

Browse files
committed
Ensure version numbers are initialized before the inversion check
1 parent 8cab4bc commit b35f3b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/update_flash.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
728728
*/
729729
update_type = wolfBoot_get_image_type(PART_UPDATE);
730730

731+
cur_ver = wolfBoot_current_firmware_version();
732+
upd_ver = wolfBoot_update_firmware_version();
733+
731734
wolfBoot_get_update_sector_flag(0, &flag);
732735
/* Check the first sector to detect interrupted update */
733736
if (flag == SECT_FLAG_NEW) {
@@ -761,8 +764,6 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
761764
}
762765
PART_SANITY_CHECK(&update);
763766

764-
cur_ver = wolfBoot_current_firmware_version();
765-
upd_ver = wolfBoot_update_firmware_version();
766767

767768
wolfBoot_printf("Versions: Current 0x%x, Update 0x%x\n",
768769
cur_ver, upd_ver);

0 commit comments

Comments
 (0)