diff options
author | Simon Glass <sjg@chromium.org> | 2014-06-12 07:24:44 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-19 11:18:57 -0400 |
commit | ba923cab0006838eb726e40207501ddf16eabd80 (patch) | |
tree | b2dd16ab8f817b5768a531caf73a63085e22e5b1 /tools/fit_check_sign.c | |
parent | d18926af30d111362c6262c356feb768d7a367a3 (diff) | |
download | u-boot-ba923cab0006838eb726e40207501ddf16eabd80.tar.gz |
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_check_sign.c')
-rw-r--r-- | tools/fit_check_sign.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/fit_check_sign.c b/tools/fit_check_sign.c index af257cc8a2..e1198bca44 100644 --- a/tools/fit_check_sign.c +++ b/tools/fit_check_sign.c @@ -62,6 +62,15 @@ int main(int argc, char **argv) break; } + if (!fdtfile) { + fprintf(stderr, "%s: Missing fdt file\n", *argv); + usage(*argv); + } + if (!keyfile) { + fprintf(stderr, "%s: Missing key file\n", *argv); + usage(*argv); + } + ffd = mmap_fdt(cmdname, fdtfile, 0, &fit_blob, &fsbuf, false); if (ffd < 0) return EXIT_FAILURE; |