File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ int wolfBoot_open_image(struct wolfBoot_image *img, uint8_t part)
211211 if (!img )
212212 return -1 ;
213213 memset (img , 0 , sizeof (struct wolfBoot_image ));
214+ img -> part = part ;
214215 if (part == PART_SWAP ) {
215216 img -> part = PART_SWAP ;
216217 img -> hdr = (void * )WOLFBOOT_PARTITION_SWAP_ADDRESS ;
@@ -237,7 +238,6 @@ int wolfBoot_open_image(struct wolfBoot_image *img, uint8_t part)
237238
238239 if (* size >= WOLFBOOT_PARTITION_SIZE )
239240 return -1 ;
240- img -> part = part ;
241241 img -> hdr_ok = 1 ;
242242 img -> fw_size = * size ;
243243 img -> fw_base = img -> hdr + IMAGE_HEADER_SIZE ;
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ static int wolfBoot_update(int fallback_allowed)
8989 if ((update .fw_size + IMAGE_HEADER_SIZE ) > total_size )
9090 total_size = update .fw_size + IMAGE_HEADER_SIZE ;
9191
92- if (total_size < IMAGE_HEADER_SIZE )
92+ if (total_size <= IMAGE_HEADER_SIZE )
9393 return -1 ;
9494
9595 /* Check the first sector to detect interrupted update */
You can’t perform that action at this time.
0 commit comments