mirror of https://github.com/wolfSSL/wolfBoot.git
Merge pull request #91 from danielinux/image-size-fix
Fixed check on FW image size in wolfBoot_open_imagepull/94/head
commit
110a89a40f
|
@ -639,7 +639,7 @@ int wolfBoot_open_image(struct wolfBoot_image *img, uint8_t part)
|
||||||
return -1;
|
return -1;
|
||||||
size = (uint32_t *)(image + sizeof (uint32_t));
|
size = (uint32_t *)(image + sizeof (uint32_t));
|
||||||
|
|
||||||
if (*size >= WOLFBOOT_PARTITION_SIZE)
|
if (*size > (WOLFBOOT_PARTITION_SIZE - IMAGE_HEADER_SIZE))
|
||||||
return -1;
|
return -1;
|
||||||
img->hdr_ok = 1;
|
img->hdr_ok = 1;
|
||||||
img->fw_size = *size;
|
img->fw_size = *size;
|
||||||
|
|
Loading…
Reference in New Issue