Skip to contentSkip to conversation

tools: mkimage: Check for datafile when type is script

PATCH In review Alex Kiernan 2 participants 2 messages Apr 22, 2018 – Apr 29, 2018

lore
Share & tools
lore
#0 lore raw

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.

---

 tools/mkimage.c | 2 ++
 1 file changed, 2 insertions(+)
tools/mkimage.c +2 -0
index 4e56182..32e07be 100644
@@ -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
#1 lore raw
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 #1 0x0000000000403818 in main

      at tools/mkimage.c:503

Add explicit test for datafile to fix this.

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>