From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 22 Dec 2011 20:55:08 +0100 Subject: [U-Boot] [PATCH] MX28: Fix MXSBOOT segfault if no params specified Message-ID: <1324583708-19459-1-git-send-email-marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Stefano Babic --- tools/mxsboot.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/tools/mxsboot.c b/tools/mxsboot.c index 176753d..8246831 100644 --- a/tools/mxsboot.c +++ b/tools/mxsboot.c @@ -606,6 +606,9 @@ int parse_ops(int argc, char **argv) }; int type; + if (argc < 4) + return -1; + for (i = 1; i < argc; i++) { if (!strncmp(argv[i], "-w", 2)) type = PARAM_WRITE; -- 1.7.7.3