From: Marek Vasut Date: Thu, 22 Dec 2011 09:55:08 +0000 (+0000) Subject: MX28: Fix MXSBOOT segfault if no params specified X-Git-Tag: v2025.01-rc5-pxa1908~18197 X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20%24image.RelPermalink%20%7D%7D?a=commitdiff_plain;h=e364daf92593e88ea8e26e31e987b1527338869c;p=u-boot.git MX28: Fix MXSBOOT segfault if no params specified Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Stefano Babic --- 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;