summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-11-05 09:53:25 +0000
committerStefano Babic <sbabic@denx.de>2018-11-06 11:23:45 +0100
commitdf439e938ceb5165297c3e34b6485af0238608ef (patch)
treeeca3e3b99f945694622f28b6be40c574aaf321ed /tools
parentfc61cc2ca3bab8fdf38572eb1ccfa6674999c8b8 (diff)
downloadu-boot-df439e938ceb5165297c3e34b6485af0238608ef.tar.gz
u-boot-df439e938ceb5165297c3e34b6485af0238608ef.tar.bz2
u-boot-df439e938ceb5165297c3e34b6485af0238608ef.zip
tools: imx8image: fix coverity CID 184234
Fix: CID 184234: (TAINTED_SCALAR) Using tainted variable "header.num_images - 1" as an index into an array "header.img". Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/imx8image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/imx8image.c b/tools/imx8image.c
index 03debe547e..019b875773 100644
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -666,8 +666,10 @@ static int get_container_image_start_pos(image_t *image_stack, uint32_t align)
}
ret = fread(&header, sizeof(header), 1, fd);
- if (ret != 1)
+ if (ret != 1) {
printf("Failure Read header %d\n", ret);
+ exit(EXIT_FAILURE);
+ }
fclose(fd);