]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: ubi: Fix 'ubi list' command arguments parsing
authorDmitry Dunaev <dunaev@tecon.ru>
Wed, 12 Jul 2023 12:58:21 +0000 (15:58 +0300)
committerHeiko Schocher <hs@denx.de>
Tue, 15 Aug 2023 05:32:13 +0000 (07:32 +0200)
This fixes allowed argc variable value for arguments parsing

Fixes: 6de1daf64b1 ("cmd: ubi: Add 'ubi list' command")
Signed-off-by: Dmitry Dunaev <dunaev@tecon.ru>
cmd/ubi.c

index b61ae1efea485664f457cfadd347b774c40a4900..0a6a80bdd1093ea536d957e81e05b8811584691c 100644 (file)
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -653,7 +653,7 @@ static int do_ubi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
        if (strcmp(argv[1], "list") == 0) {
                int numeric = 0;
-               if (argc >= 2 && argv[2][0] == '-') {
+               if (argc >= 3 && argv[2][0] == '-') {
                        if (strcmp(argv[2], "-numeric") == 0)
                                numeric = 1;
                        else