From: Stefano Babic Date: Thu, 15 Sep 2011 23:50:15 +0000 (+0000) Subject: mkimage: ublimage must return if the header is not verified X-Git-Url: http://git.dujemihanovic.xyz/html/index.html?a=commitdiff_plain;h=163967905f9e41232d5f7c525a9811a200fe30ba;p=u-boot.git mkimage: ublimage must return if the header is not verified Each image handler must return a not-zero velue if the header is not recognized to allow the main program to iterate to the next handler. Signed-off-by: Stefano Babic CC: Heiko Schocher Acked-by: Heiko Schocher --- diff --git a/tools/ublimage.c b/tools/ublimage.c index 99874622d0..d6b401738a 100644 --- a/tools/ublimage.c +++ b/tools/ublimage.c @@ -214,6 +214,11 @@ static int ublimage_check_image_types(uint8_t type) static int ublimage_verify_header(unsigned char *ptr, int image_size, struct mkimage_params *params) { + struct ubl_header *ubl_hdr = (struct ubl_header *)ptr; + + if ((ubl_hdr->magic & 0xFFFFFF00) != UBL_MAGIC_BASE) + return -1; + return 0; }