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 46AD4C433EF for ; Wed, 13 Oct 2021 15:35:21 +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 78B8E61154 for ; Wed, 13 Oct 2021 15:35:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 78B8E61154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz 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 8E4F783373; Wed, 13 Oct 2021 17:35:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz 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; secure) header.d=nic.cz header.i=@nic.cz header.b="Suk5Bli1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 656A483431; Wed, 13 Oct 2021 17:35:15 +0200 (CEST) Received: from mail.nic.cz (lists.nic.cz [217.31.204.67]) (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 AB3C083347 for ; Wed, 13 Oct 2021 17:35:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from dellmb (unknown [IPv6:2001:1488:fffe:6:8747:7254:5571:3010]) by mail.nic.cz (Postfix) with ESMTPSA id 6AC6A140D22; Wed, 13 Oct 2021 17:35:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1634139312; bh=9xl3BzpmcDcDrYen/4SVrk7AM3/SIf/n79m1Dg3vNpo=; h=Date:From:To; b=Suk5Bli1hE30cMFJK0Va2y85wKsk0n9X1Ig1fhpV115JHCi1EAuJQCuV+oil2uZBW yh2eM188qWxxSKrlDQ1jO0f4UJ5U3v6/ILpXfRKh99JVgWhxNoAAORFZf514QT88SB fJmVdul9d5jBU+OVhmKbbMtOMrkdl8O/oQf4SDrI= Date: Wed, 13 Oct 2021 17:35:09 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Simon Glass , Tom Rini Cc: U-Boot Mailing List Subject: Re: [PATCH 05/10] env: Check for terminating null-byte in env_match() Message-ID: <20211013173509.21198d4d@dellmb> In-Reply-To: <20211012110501.6118-6-kabel@kernel.org> References: <20211012110501.6118-1-kabel@kernel.org> <20211012110501.6118-6-kabel@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Tue, 12 Oct 2021 13:04:56 +0200 Marek Beh=C3=BAn wrote: > - while (*s1 =3D=3D env_get_char(i2++)) > + while (*s1 !=3D '\0' && *s1 =3D=3D env_get_char(i2++)) This check has to be done in the other order: while (*s1 =3D=3D env_get_char(i2++) && *s1 !=3D '\0') so that i2 gets incremented even if *s1 =3D=3D '\0'. Will be fixed in v2.