From 835c30e368e9661a6d99179d948f64efebf5d1de Mon Sep 17 00:00:00 2001 From: Troy Kisky Date: Mon, 21 Sep 2015 14:02:48 -0700 Subject: [PATCH] imximage: header.length of 4 is valid Signed-off-by: Troy Kisky --- tools/imximage.c | 4 ++-- 1 file 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)), -- 2.25.1