summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2015-09-21 14:02:48 -0700
committerStefano Babic <sbabic@denx.de>2015-10-07 13:24:35 +0200
commit835c30e368e9661a6d99179d948f64efebf5d1de (patch)
tree6e3464d7c59d5617d124ae5571893a88ca4a8a05
parent7daaac5281db0788cde895a0add38ad5195b5be1 (diff)
downloadu-boot-imx-835c30e368e9661a6d99179d948f64efebf5d1de.zip
u-boot-imx-835c30e368e9661a6d99179d948f64efebf5d1de.tar.gz
u-boot-imx-835c30e368e9661a6d99179d948f64efebf5d1de.tar.bz2
imximage: header.length of 4 is valid
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
-rw-r--r--tools/imximage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/imximage.c b/tools/imximage.c
index 0da48a7..7e60bf5 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -361,8 +361,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
dcd_v2_t *dcd_v2 = &hdr_v2->dcd_table;
uint32_t size, version;
- size = be16_to_cpu(dcd_v2->header.length) - 8;
- if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t))) {
+ size = be16_to_cpu(dcd_v2->header.length);
+ if (size > (MAX_HW_CFG_SIZE_V2 * sizeof(dcd_addr_data_t)) + 8) {
fprintf(stderr,
"Error: Image corrupt DCD size %d exceed maximum %d\n",
(uint32_t)(size / sizeof(dcd_addr_data_t)),