summaryrefslogtreecommitdiff
path: root/tools/fit_info.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-06-12 07:24:44 -0600
committerTom Rini <trini@ti.com>2014-06-19 11:18:57 -0400
commitba923cab0006838eb726e40207501ddf16eabd80 (patch)
treeb2dd16ab8f817b5768a531caf73a63085e22e5b1 /tools/fit_info.c
parentd18926af30d111362c6262c356feb768d7a367a3 (diff)
downloadu-boot-imx-ba923cab0006838eb726e40207501ddf16eabd80.zip
u-boot-imx-ba923cab0006838eb726e40207501ddf16eabd80.tar.gz
u-boot-imx-ba923cab0006838eb726e40207501ddf16eabd80.tar.bz2
tools: Check arguments in fit_check_sign/fit_info
These tools crash if no arguments are provided. Add checks to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'tools/fit_info.c')
-rw-r--r--tools/fit_info.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/fit_info.c b/tools/fit_info.c
index afbed7b..481ac6d 100644
--- a/tools/fit_info.c
+++ b/tools/fit_info.c
@@ -68,6 +68,18 @@ int main(int argc, char **argv)
break;
}
+ if (!fdtfile) {
+ fprintf(stderr, "%s: Missing fdt file\n", *argv);
+ usage(*argv);
+ }
+ if (!nodename) {
+ fprintf(stderr, "%s: Missing node name\n", *argv);
+ usage(*argv);
+ }
+ if (!propertyname) {
+ fprintf(stderr, "%s: Missing property name\n", *argv);
+ usage(*argv);
+ }
ffd = mmap_fdt(cmdname, fdtfile, 0, &fit_blob, &fsbuf, false);
if (ffd < 0) {