Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD609EB64DA for ; Wed, 12 Jul 2023 19:04:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7B5886BC2; Wed, 12 Jul 2023 21:04:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=tecon.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 12975869B6; Wed, 12 Jul 2023 14:58:38 +0200 (CEST) Received: from mail.tecon.ru (mail.tecon.ru [82.112.190.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E2043868EC for ; Wed, 12 Jul 2023 14:58:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=tecon.ru Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dunaev@tecon.ru From: Dmitry Dunaev To: CC: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Dmitry Dunaev Subject: [PATCH] cmd: ubi: Fix 'ubi list' command arguments parsing Date: Wed, 12 Jul 2023 15:58:21 +0300 Message-ID: <20230712125821.41233-1-dunaev@tecon.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailman-Approved-At: Wed, 12 Jul 2023 21:04:17 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This fixes allowed argc variable value for arguments parsing Fixes: 6de1daf64b1 ("cmd: ubi: Add 'ubi list' command") Signed-off-by: Dmitry Dunaev --- cmd/ubi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ubi.c b/cmd/ubi.c index b61ae1efea..0a6a80bdd1 100644 --- 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 -- 2.34.1