From patchwork Thu Jun 15 08:26:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Oberfichtner X-Patchwork-Id: 1795271 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::53e; helo=mail-pg1-x53e.google.com; envelope-from=swupdate+bncbaabb7uwvosamgqervvch2q@googlegroups.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20221208 header.b=GlRI57cP; dkim-atps=neutral Received: from mail-pg1-x53e.google.com (mail-pg1-x53e.google.com [IPv6:2607:f8b0:4864:20::53e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qhb5J1WNtz20WR for ; Thu, 15 Jun 2023 18:27:46 +1000 (AEST) Received: by mail-pg1-x53e.google.com with SMTP id 41be03b00d2f7-53f44c2566dsf3814662a12.2 for ; Thu, 15 Jun 2023 01:27:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686817664; cv=pass; d=google.com; s=arc-20160816; b=C6iy/4i+RGFar7Fn0hYJUczib0VIKEIF2DTZMpVd/VJUmE0LyHezs3z+jeRWIl+Uxl YYKckA/Qmzrda877rZVXJ6Z9zsFp7s9U0Mxw7zaExzzXkmXR0773SvYz2pjPsFEWUjE9 tEEP/w3oPXt5TZ9lSAaDK7c0dFkFezhBuT3abhDyDP20tJqM+vNw+OUVltt7ZfF0KrNn zBiYKuCEWDox5x8ZfZ3sH5HL/sx48r8O1A4YnBI2Xz/yB4z0mVnWX+nkrrol1TVWfd9y hLrAeTDc+GDRQjbIxcgSj7ORvmfZbFSVAsBgNmyLdvVOhVWV2G0UR7e6112KVKGMLXXn QsTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=6LVn1ESJxSy/fI48Dg7R6OdU5liBaSP8KWcwrx6XdqU=; b=R94sSV+Lkz8r4/aGcsck4iNfjEj06LyJ80dlURsMOrR7+VtxfRcNa3rmiqjKKGZYH7 Kyj6l5fPaGPCaV4QXorbvJzbqRCuCKxL0wokICmoVQf46DVp0MBtBsf+Xt810VX3LKnH so9UIMMzZWtpdEuiIDQl2y/VUS/0U5epKEPYIPshsCLJ9m4sineB/p4GchCoT9UlS9c/ 8c8SQPszk/Ri8jTyn6Y317FUWMf5siFaTBDD9yYw2VoCUtvK6S31xnMceAJtnFdY+gAA ROqxtiQ3JkFr9k+s397GGpWvex7YqrDbNePaYc7nFyhHhBgOXwUKN5Os3dRB9cmFm2El DKlQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=UJ8kt5X8; spf=pass (google.com: domain of pro@denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=pro@denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1686817664; x=1689409664; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=6LVn1ESJxSy/fI48Dg7R6OdU5liBaSP8KWcwrx6XdqU=; b=GlRI57cP7mvHDbS97FgNLKj2Pq6BKZhW0foJfvmJDncIJkH39hAROymzHdfh53/IAG rd94rNla/+WYMqanPMF6+kDjbcy2ZyYm4TE6PRXdIFgNqrXb+XQs8LZnBfyl7G2bJ8p6 ctrsvxFwVwxIg96w4sQAXv/eMh5bYHIdwkJP3GGOtCKcpR6Fk8/khYkqlh4PKPXISUU1 priZHsNEkJh+p6Io9gjL4l7/vhUntlT0Yx40MXJZuDYBplf7FVNTVvVdmONpmLwgz7TK dsArwXn+HvHet308wjq3eSfm28yKAzwwqztm+6tYIKH6laH6F8tneVkic3WjnczPfVlG 7Y1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686817664; x=1689409664; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=6LVn1ESJxSy/fI48Dg7R6OdU5liBaSP8KWcwrx6XdqU=; b=HQ2fr2kWLrtIf4CGpznazTWy5Ewtw5xDWhWPhjxlZJ9sxmqmxq0QD8pcy5LCeu2Cuc uqXzhF/eWc6E3wjcuFACNPze1eEQ7grCMTGQjAAS9+IAqVbzsRBfV8DP9SUkZhR8FfKf WUsboqsb+9+AG+2Pb1l0jKvqAHdclaFXYJVgyqkk+EU9+8N8iSOQX6WtLUeAATcLMjs3 iCSdeo4Fwdy4qtqecMJRCE7XnluUFRM7oI7K+Wyq01pEtprtHFCHpuZKb0CHTKtn6PZB lOc2g6l2C2bb3YBNmiWBdJ3t+XAsPxcj6OV6uOr8+CGrZ/RpmMU1f8jP3W40ykz2m1zZ s91Q== Sender: swupdate@googlegroups.com X-Gm-Message-State: AC+VfDw8ySn1MDICdM5k2wDHCBBb168D/SegnlQyopCHbpchC+Rk7TWe u+wwAhaJP4U7OF7kJXG27ZM= X-Google-Smtp-Source: ACHHUZ5PU7M7vDnzVn3erPxueJXS2477YnP6SUn87aK29092C1inbUdlkF/9/ebaEmc6xuXB8inr3g== X-Received: by 2002:a05:6a20:431c:b0:10c:4c76:e909 with SMTP id h28-20020a056a20431c00b0010c4c76e909mr3833549pzk.8.1686817663501; Thu, 15 Jun 2023 01:27:43 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a17:902:f312:b0:1b5:e37:c0f8 with SMTP id c18-20020a170902f31200b001b50e37c0f8ls623498ple.1.-pod-prod-02-us; Thu, 15 Jun 2023 01:27:42 -0700 (PDT) X-Received: by 2002:a17:902:bd94:b0:1b3:d6c8:7008 with SMTP id q20-20020a170902bd9400b001b3d6c87008mr7577019pls.57.1686817662337; Thu, 15 Jun 2023 01:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686817662; cv=none; d=google.com; s=arc-20160816; b=Lc8paeRepCZAZUDsfmNclcZLr81XWvj4JjVZp4MHVhp34KJ+poRjCnoSaXvYLuJRhI Noy9sHH0V5/IDRmVjNKmY4raEJajoYFfim6qpZM/5uU/UBW3MJdQorUNp/X23NagNCv2 /LfQMoFxt1CnKCD6gan0BB+Hd4XlCLus12HoblMVv2xQWPGL10TcOSCcTCi4+FKZ2Ep8 GcNIF57iMjKfedmDtT8YOgEPY4Jf3+vdA0mFo5JpYGVgAGGCFyqNSeGapmISh2Y9LPNf lud2VekezXcJnww1MaVHsmE7xyXq99dRsOly79hgzSq/QFFvftH/Cv4GCS5y9CxbtO6V 1QCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=t/1sGrpeVh0II4cC3KSia2KHQXARko6M9mhctHiZZf8=; b=B2ZWm2OSBzWanI8l9XNXSS1ZmXvkLBGLhj/NO56m1Jzb850tK7NSNr6FbwbTuwgOo0 I8wiIQ86f8sQaoODVIalXqi8z+oqDLDCeWfxC+ORCopQArgO773wLqeSIJIsaXJV6iOV H1OZMblyw6WcgqqUyaFRBQJj9UWrf1xkP1nQGaqnuzh6hSzmXuXWRUKZgSIsuF7waldi QMR9JgIZRsmr20FIFP9vSFZhrfhxI5KaH3GoMUTIwtzz8LZ09JF+RxkexT4FhVJGLFJc TpvGOrfJqKAGZKv7ZWiZ5f0r1b89XLghC3CXaq96iBtfKPniTMEoYgNiRDtzFHsIRFxF amAA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=UJ8kt5X8; spf=pass (google.com: domain of pro@denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=pro@denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gmr-mx.google.com with ESMTPS id b3-20020a170902d88300b001b3df16bb8csi443323plz.13.2023.06.15.01.27.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 01:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of pro@denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Received: from mail-internal.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (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 C167986225 for ; Thu, 15 Jun 2023 10:27:37 +0200 (CEST) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTPS id B34D818068A for ; Thu, 15 Jun 2023 10:27:32 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 535) id 849AE1A0094; Thu, 15 Jun 2023 10:27:32 +0200 (CEST) From: Philip Oberfichtner To: swupdate@googlegroups.com Cc: sbabic@denx.de, Philip Oberfichtner Subject: [swupdate] [libubootenv PATCH 1/2] validate_flags: Bugfix for TYPE_ATTR_HEX Date: Thu, 15 Jun 2023 10:26:49 +0200 Message-Id: <20230615082650.2693630-1-pro@denx.de> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-Original-Sender: pro@denx.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=UJ8kt5X8; spf=pass (google.com: domain of pro@denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=pro@denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , value should start with the '0' character, corresponding to 0x30. Before this patch we checked for 0x00 instead. Signed-off-by: Philip Oberfichtner Reviewed-by: Stefano Babic --- src/uboot_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uboot_env.c b/src/uboot_env.c index 3320753..a31e459 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -1711,7 +1711,7 @@ static bool libuboot_validate_flags(struct var_entry *entry, const char *value) case TYPE_ATTR_DECIMAL: case TYPE_ATTR_HEX: errno = 0; - ok_type = strlen(value) > 2 && (value[0] == 0) && + ok_type = strlen(value) > 2 && (value[0] == '0') && (value[1] == 'x' || value [1] == 'X'); if (ok_type) { test = strtoull(value, NULL, 16);