From c9cb4089974025157a2454d8564316962bf79f0f Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 26 Oct 2016 13:24:26 +0900 Subject: [PATCH] fiptool: fix Segmentation fault when only --verbose option is given Fix the following bug: $ tools/fiptool/fiptool -v Segmentation fault (core dumped) Signed-off-by: Masahiro Yamada --- tools/fiptool/fiptool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/fiptool/fiptool.c b/tools/fiptool/fiptool.c index b3f02f6c..4b82c37e 100644 --- a/tools/fiptool/fiptool.c +++ b/tools/fiptool/fiptool.c @@ -983,6 +983,8 @@ int main(int argc, char *argv[]) strcmp(argv[0], "--verbose") == 0) { verbose = 1; argc--, argv++; + if (argc < 1) + usage(); } for (i = 0; i < NELEM(cmds); i++) { -- 2.30.2