From: Pantelis Antoniou Date: Fri, 30 Nov 2012 08:01:08 +0000 (+0000) Subject: dfu: Fix crash when wrong number of arguments given X-Git-Tag: v2013.04-rc2~23^2~17 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=df93cd9c6f620039ddcbbf68e8cfa3c3f0dba76f;p=oweals%2Fu-boot.git 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 --- 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; }