From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59C45C11F68 for ; Wed, 30 Jun 2021 07:38:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5A944611F2 for ; Wed, 30 Jun 2021 07:38:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A944611F2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B823583259; Wed, 30 Jun 2021 09:38:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625038704; bh=HbHQrtRASrdlpx1HlMJXLuX54xlaAZbIu7HeXM/8dgM=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GXH6ym7G+fzR2k7/qvBXoNOJfLvMW/+om3eQWDFpxOaiEjv7E8Kvi6foSz1Kz7HIb j0Fjb9FXg/ymj7Sdi8U7u3QsgcbrMLWDDvK4UnSvI0N/fd3DrZfP66y9NZ9eaF7hd7 hgj7RDoW2AKgcKS1Jnd9g1c3crqCPZzkZLQYrI3v/KxgF9gMFMcZ8wemmswJwCrDp8 Pu4UvCOooCYJrhw2KvIF5tpIGq5Fgu6yfvvXsPxvDB6jl/2NpbFJV6V3l90v4sWvA/ FcWG4H0Vkcn38N/t14YswoyYfmvu0OxukGH6oFzNj1moHgdj+f9CA/0ApAZn0gg9KB SOCeOtFEbQboA== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id BA0C883252 for ; Wed, 30 Jun 2021 09:38:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625038702; bh=HbHQrtRASrdlpx1HlMJXLuX54xlaAZbIu7HeXM/8dgM=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=CoSc2gksB+XiO3EJT1CbH3QgHkgl2af0boY/DCNm0D/C6i/J84KtA0tSqErpRBe+E r2VBlwzDyBB6/jvLx+IwXvHORcLQjd1Had2o5yi+HpAJWoKgvDzqSGsttl5f8RioFT G9y3mEBeTSZjFZgazwI2C9Dupts5htjuLv/rjQB7bb8Y3CWiVISa1w8ItwBUvd9Nd7 1QviP135+IQPUb9CTIHIs6pTU39mJP3l89+Dsgit6NhJIPSRF4+QwPVPlZGKj3ybQY 7gtIN4aOvMrEjo2oIG/z+iCBafiBjw3M5mhTRbfBsc4pfFl3igAwjdjNuAL8ujbhTK uEVm4UShj+xfA== Received: by janitor.denx.de (Postfix, from userid 108) id 74140A0250; Wed, 30 Jun 2021 09:38:22 +0200 (CEST) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id E3580A003B; Wed, 30 Jun 2021 09:38:16 +0200 (CEST) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id A58BC1E1DD2; Wed, 30 Jun 2021 09:38:16 +0200 (CEST) To: Francis Laniel cc: u-boot@lists.denx.de, joe.hershberger@ni.com, michael@amarulasolutions.com, ondrej@amarulasolutions.com From: Wolfgang Denk Subject: Re: [RFC PATCH v2 1/1] cmd: nvedit: Forbid key to be empty. MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20210629161859.298630-2-francis.laniel@amarulasolutions.com> References: <20210629161859.298630-1-francis.laniel@amarulasolutions.com> <20210629161859.298630-2-francis.laniel@amarulasolutions.com> Comments: In-reply-to Francis Laniel message dated "Tue, 29 Jun 2021 18:18:59 +0200." Date: Wed, 30 Jun 2021 09:38:16 +0200 Message-ID: <138836.1625038696@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Dear Francis Laniel, In message <20210629161859.298630-2-francis.laniel@amarulasolutions.com> you wrote: > Before this patch, it was possible to do the following using setenv: > setenv '' foo > Then, on next reboot, U-Boot will not be able to parse environment due to it > having: > =foo > > Now, if the above command is given, an error message is thrown and environment > is not modified. > > Signed-off-by: Francis Laniel > --- > cmd/nvedit.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/cmd/nvedit.c b/cmd/nvedit.c > index d14ba10cef..6f99a85a9c 100644 > --- a/cmd/nvedit.c > +++ b/cmd/nvedit.c > @@ -262,6 +262,11 @@ static int _do_env_set(int flag, int argc, char *const argv[], int env_flag) > return 1; > } > > + if (*name == '\0') { > + printf("## Error: variable name must no be empty\n"); > + return 1; > + } > + > env_id++; > > /* Delete only ? */ Reviewed-by: Wolfgang Denk Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "I can call spirits from the vasty deep." "Why so can I, or so can any man; but will they come when you do call for them?" - Shakespeare, 1 King Henry IV, Act III, Scene I.