提交 5029d7bf 编写于 作者: P Pali Rohár 提交者: Stefan Roese

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: NPali Rohár <pali@kernel.org>
Reviewed-by: NMarek Behún <marek.behun@nic.cz>
Reviewed-by: NStefan Roese <sr@denx.de>
上级 825a2ca0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册