]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
MX28: Fix MXSBOOT segfault if no params specified
authorMarek Vasut <marek.vasut@gmail.com>
Thu, 22 Dec 2011 09:55:08 +0000 (09:55 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 16 Jan 2012 07:40:09 +0000 (08:40 +0100)
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
tools/mxsboot.c

index 176753d2ce07078dc1fe053b70539ab9c45822bd..8246831d8ef76571c539d90d9ce5014134b33789 100644 (file)
@@ -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;