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 4B80EC11F65 for ; Wed, 30 Jun 2021 07:45:51 +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 08511613B5 for ; Wed, 30 Jun 2021 07:45:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08511613B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com 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 5CF4183273; Wed, 30 Jun 2021 09:45:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="SAuhp27x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE9EF83275; Wed, 30 Jun 2021 09:45:46 +0200 (CEST) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6B25283273 for ; Wed, 30 Jun 2021 09:45:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=francis.laniel@amarulasolutions.com Received: by mail-wr1-x432.google.com with SMTP id v5so2395731wrt.3 for ; Wed, 30 Jun 2021 00:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jLj814clXNfsYq5O33nJFYJjEpmtNtXzTeMMuIQWB9o=; b=SAuhp27xwAGNvcbgYoZNgnEwzUbxlkJYB7imP4wDn7gZjSC0lKtshFSBu01RHMobSg KSnIGIPLj/e1FuvzJUDMlQl2m/j39FbsiHLX/CQYHDO/FT57AfOEPztBjw32I1nK6nF6 ykYbxTO3CprjyHBDyqhGTMoRaDmALNGiLgbk8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jLj814clXNfsYq5O33nJFYJjEpmtNtXzTeMMuIQWB9o=; b=ItrSRmji7LIOznWNNXxat1iK4CbVpUdiN7qdC7joJFOHvyeJh8/sZzYIbScZbtP20V tldixvjCRkh1dsrJ2cs0ZEQ0CQenAtxSjnAsQ6V9qGOs9k0M2aF7bfGXk6lrdJFpa0QT 30a3zQa9I1tsq0o8KwcpzXB5Ks3rqJrDGsq11dxcARRO1jWQuC9BqyIZK+L1riZzkK0E T4Ts2PZWXcwhiUaaHticGsssx87f/5B8miuuup0GpeLn323jQ1Jc64khRfXm6F3tny0L nSFPLJ8O3gWFfBnRufom8KQ90o3M6ffrzB6dz6VMu0qwtBN+kwqd65Kbr8/sGPCAbsXa EkUw== X-Gm-Message-State: AOAM530NRaI2foAAjfIkcXZPMocgkZWjR1BMPD1znZuXnNL6p/CpURMO P2AHhbc9Q5yGs/JekWw7YxOBHg== X-Google-Smtp-Source: ABdhPJwoaCWzTeYPjYTnVZ1b5lWk4it/wBFZyMS5cK+LSReeWzdA5imq2TySUajarGjvnusOElIE8Q== X-Received: by 2002:adf:fd42:: with SMTP id h2mr4648646wrs.262.1625039143039; Wed, 30 Jun 2021 00:45:43 -0700 (PDT) Received: from pwmachine.localnet ([2a01:cb14:983:1f00:624:e0b:d827:fb0a]) by smtp.gmail.com with ESMTPSA id 16sm7796886wmk.18.2021.06.30.00.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 00:45:42 -0700 (PDT) From: Francis Laniel To: Wolfgang Denk Cc: u-boot@lists.denx.de, joe.hershberger@ni.com, michael@amarulasolutions.com, ondrej@amarulasolutions.com Subject: Re: [RFC PATCH v2 1/1] cmd: nvedit: Forbid key to be empty. Date: Wed, 30 Jun 2021 09:45:41 +0200 Message-ID: <2586149.mvXUDI8C0e@pwmachine> In-Reply-To: <138836.1625038696@gemini.denx.de> References: <20210629161859.298630-1-francis.laniel@amarulasolutions.com> <20210629161859.298630-2-francis.laniel@amarulasolutions.com> <138836.1625038696@gemini.denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" 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 Hi. Le mercredi 30 juin 2021, 09:38:16 CEST Wolfgang Denk a =E9crit : > Dear Francis Laniel, >=20 > In message <20210629161859.298630-2-francis.laniel@amarulasolutions.com> = you=20 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: > > =3Dfoo > >=20 > > Now, if the above command is given, an error message is thrown and > > environment is not modified. > >=20 > > Signed-off-by: Francis Laniel > > --- > >=20 > > cmd/nvedit.c | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > 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)>=20 > > return 1; > > =09 > > } > >=20 > > + if (*name =3D=3D '\0') { > > + printf("## Error: variable name must no be empty\n"); > > + return 1; > > + } > > + > >=20 > > env_id++; > > =09 > > /* Delete only ? */ >=20 > Reviewed-by: Wolfgang Denk Thank you for the review! >=20 > Best regards, >=20 > Wolfgang Denk