Commit 163967905f9e41232d5f7c525a9811a200fe30ba
Committed by
Wolfgang Denk
1 parent
9400f8fa7c
Exists in
master
and in
54 other branches
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 <sbabic@denx.de> CC: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
tools/ublimage.c
... | ... | @@ -214,6 +214,11 @@ |
214 | 214 | static int ublimage_verify_header(unsigned char *ptr, int image_size, |
215 | 215 | struct mkimage_params *params) |
216 | 216 | { |
217 | + struct ubl_header *ubl_hdr = (struct ubl_header *)ptr; | |
218 | + | |
219 | + if ((ubl_hdr->magic & 0xFFFFFF00) != UBL_MAGIC_BASE) | |
220 | + return -1; | |
221 | + | |
217 | 222 | return 0; |
218 | 223 | } |
219 | 224 |