summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPantelis Antoniou <panto@antoniou-consulting.com>2012-11-30 08:01:08 +0000
committerTom Rini <trini@ti.com>2013-02-15 14:25:53 -0500
commitc8adc11eb9dc4b294379642a6b0308312ff4bec8 (patch)
treef412037cf32cc12e7351ed699b33eae32f432e1c
parent7727c5370932c6a19e4d84e48621c8f421f4f4cb (diff)
dfu: Fix crash when wrong number of arguments given
Fix obvious crash when not enough arguments are given to the dfu command. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
-rw-r--r--common/cmd_dfu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
index 327c738af7..83ef32497a 100644
--- a/common/cmd_dfu.c
+++ b/common/cmd_dfu.c
@@ -50,7 +50,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (ret)
return CMD_RET_FAILURE;
- if (strcmp(argv[3], "list") == 0) {
+ if (argc > 3 && strcmp(argv[3], "list") == 0) {
dfu_show_entities();
goto done;
}