mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
tools: kwboot: Fix checking image header version
Function image_version() returns unsigned value, so it can never be negative. Explicitly check for two supported image versions: v0 and v1. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
825a2ca023
commit
5029d7bf34
1 changed files with 1 additions and 1 deletions
|
@ -634,7 +634,7 @@ kwboot_img_patch_hdr(void *img, size_t size)
|
|||
}
|
||||
|
||||
image_ver = image_version(img);
|
||||
if (image_ver < 0) {
|
||||
if (image_ver != 0 && image_ver != 1) {
|
||||
fprintf(stderr, "Invalid image header version\n");
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
|
|
Loading…
Reference in a new issue