From e364daf92593e88ea8e26e31e987b1527338869c Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2011 09:55:08 +0000 Subject: [PATCH] MX28: Fix MXSBOOT segfault if no params specified Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Stefano Babic --- tools/mxsboot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/mxsboot.c b/tools/mxsboot.c index 176753d2ce..8246831d8e 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; -- 2.25.1