Merge pull request #91 from danielinux/image-size-fix

Fixed check on FW image size in wolfBoot_open_image
pull/94/head
David Garske 2020-11-30 07:30:01 -08:00 committed by GitHub
commit 110a89a40f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -639,7 +639,7 @@ int wolfBoot_open_image(struct wolfBoot_image *img, uint8_t part)
return -1;
size = (uint32_t *)(image + sizeof (uint32_t));
if (*size >= WOLFBOOT_PARTITION_SIZE)
if (*size > (WOLFBOOT_PARTITION_SIZE - IMAGE_HEADER_SIZE))
return -1;
img->hdr_ok = 1;
img->fw_size = *size;