tools: mkimage: Check for datafile when type is script
PATCH 1/1 tools: mkimage: Check for datafile when type is script
If generating a script image and no datafile has been passed in, mkimage dies with SIGSEGV:
#0 __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32 #1 0x0000000000403818 in main
at tools/mkimage.c:503
Add explicit test for datafile to fix this.
Signed-off-by Alex Kiernan <[email protected]>
---
tools/mkimage.c | 2 ++ 1 file changed, 2 insertions(+)
tools/mkimage.c +2 -0
@@ -301,6 +301,8 @@ static void process_args(int argc, char **argv)else if (!params.datafile)usage ("Missing data file for auto-FIT (use -d)" ); }else if (type !=IH_TYPE_INVALID ) { +if (type ==IH_TYPE_SCRIPT && !params.datafile) +usage ("Missing data file for script (use -d)" ); params.type = type; }
Signature · 1 line
2.7.4
Quoted 10 lines · Alex Kiernan
If generating a script image and no datafile has been passed in, mkimage dies with SIGSEGV:
#0
__strchr_sse2() at../sysdeps/x86_64/multiarch/../strchr.S:32#10x0000000000403818in mainat tools/mkimage.c:503Add explicit test for datafile to fix this.
Signed-off-by Alex Kiernan <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180429/723f07f2/attachment.sig>