From: Troy Kisky Date: Mon, 21 Sep 2015 21:02:48 +0000 (-0700) Subject: imximage: header.length of 4 is valid X-Git-Tag: v2025.01-rc5-pxa1908~11567^2~1 X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-favicon.png?a=commitdiff_plain;h=835c30e368e9661a6d99179d948f64efebf5d1de;p=u-boot.git imximage: header.length of 4 is valid Signed-off-by: Troy Kisky --- 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)),