From patchwork Wed Nov 28 12:43:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,4/9] Fix crash when wrong number of arguments given X-Patchwork-Submitter: Pantelis Antoniou X-Patchwork-Id: 202249 X-Patchwork-Delegate: marek.vasut@gmail.com Message-Id: <1354106642-4587-5-git-send-email-panto@antoniou-consulting.com> To: Marek Vasut , u-boot@lists.denx.de Cc: Tom Rini , Pantelis Antoniou Date: Wed, 28 Nov 2012 14:43:57 +0200 From: Pantelis Antoniou List-Id: U-Boot discussion Fix obvious crash when not enough arguments are given to the dfu command. Signed-off-by: Pantelis Antoniou --- common/cmd_dfu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c index 327c738..83ef324 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; }