summaryrefslogtreecommitdiff
path: root/tools/imximage.c
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 /tools/imximage.c
parent7daaac5281db0788cde895a0add38ad5195b5be1 (diff)
imximage: header.length of 4 is valid
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Diffstat (limited to 'tools/imximage.c')
-rw-r--r--tools/imximage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/imximage.c b/tools/imximage.c
index 0da48a733d..7e60bf5d39 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)),