aboutsummaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2018-04-22 05:11:17 +0000
committerTom Rini <trini@konsulko.com>2018-04-28 18:32:25 -0400
commit8c84287a0f225e29b688bda848e49a555c68a442 (patch)
treec2526766a9f90779a71fe1b26100378eb37d5851 /tools/mkimage.c
parentc3b115f4b7b05203da4233463a4fb87fa9c267ac (diff)
downloadu-boot-8c84287a0f225e29b688bda848e49a555c68a442.zip
u-boot-8c84287a0f225e29b688bda848e49a555c68a442.tar.gz
u-boot-8c84287a0f225e29b688bda848e49a555c68a442.tar.bz2
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 <alex.kiernan@gmail.com>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 4e56182..32e07be 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -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;
}