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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ABA7C433EF for ; Sun, 17 Oct 2021 15:38:16 +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 22A3460ED5 for ; Sun, 17 Oct 2021 15:38:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 22A3460ED5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 62673807D5; Sun, 17 Oct 2021 17:37:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Th3zgfML"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 48F3881197; Sun, 17 Oct 2021 17:37:06 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 00217832EA for ; Sun, 17 Oct 2021 17:36:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id CA1DB611AF; Sun, 17 Oct 2021 15:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634485012; bh=kB1itiglQUcIeRCsnaAI/olUkHRfjS0jYemsr4wb/IM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Th3zgfMLIXPbc5VsYpIEAb/AQyRiD/n/xuiTUjXJ7z5oHNvlH5oEEWmXDe0efRyNi 0j11PHZFDnBZ/OJqCOEeScgyCQUhMCmjWB57XC3TRtWgErzps1SrqwgHlNhLna2wQy /Cy0oUg6lgXIWF8IzpKR57QFMmSOHYyBdm7X/KG+fZbXdXOdHDzIiMBH9LLnWEstdN uxQKlo2q0HzWRm4a6pDFt5pyd4r0adI6EAkMWU2UBHxCHMOmIU1A7tA8/BOGZaotaM HMuBdK1f5Ll6yEsv6IEQbYbMUhEkmp/IpU1gLC0v/RV9NuSkFke4x7IwH9i9dsgJZY Yq/UqTxVxZCqw== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Simon Glass , Tom Rini Cc: U-Boot Mailing List , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH v3 08/13] env: Don't match empty variable name in env_match() Date: Sun, 17 Oct 2021 17:36:33 +0200 Message-Id: <20211017153638.29870-9-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211017153638.29870-1-kabel@kernel.org> References: <20211017153638.29870-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Marek BehĂșn Do we really allow zero-length variable name? I guess not. Signed-off-by: Marek BehĂșn Reviewed-by: Simon Glass --- cmd/nvedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 5b1d4c2448..8d53579d92 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -708,7 +708,7 @@ char *from_env(const char *envvar) static const char *env_match(const char *p, const char *s1) { - if (s1 == NULL) + if (s1 == NULL || *s1 == '\0') return NULL; while (*s1 == *p++) -- 2.32.0