From nobody Mon Feb 9 16:19:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+68981+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68981+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1608138504; cv=none; d=zohomail.com; s=zohoarc; b=NtRWA/tGqFdgaK3c19ZPRF1Ab+NCdulBVvl4kdqeJGXsnsx8KrAAZ+BZzQI+4BWBq49+FXcTWUyIql1Qyf2/VShJ0j78KDitPpN0osRGUBJ/WcXdE0lIHuobGfYUkC1A777pI09ZFi3gHJM0pqNlB0us5PZelwSz5deKrsxQCoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608138504; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=YX8/Vkdv/jpLGbYUHMNES8K4zyLu4u1dyXxftOMtN1g=; b=VAkgePsgFywySyvKMHOA0ZRalJXXr/q+cklzGUrIluz9M1sd6pVBo5/GOxj+ZneaulW4FwwCxMNt8kK0gKlFFlynePiT2mSBaYZp3qxAoI1h1+wOgVVBy0QJerg+xK+NdatNXx+sbfd7JD6BnjgfPFEEq2bIRo8iJGfILhTRPyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+68981+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608138504696952.0839238903911; Wed, 16 Dec 2020 09:08:24 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 43kZYY1788612xiI636r7R7L; Wed, 16 Dec 2020 09:08:22 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.11536.1608138321960796508 for ; Wed, 16 Dec 2020 09:05:22 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DBAFD6E; Wed, 16 Dec 2020 09:05:21 -0800 (PST) X-Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2F5143F66E; Wed, 16 Dec 2020 09:05:19 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, bob.c.feng@intel.com, gaoliming@byosoft.com.cn, yuwei.chen@intel.com Cc: sami.mujawar@arm.com Subject: [edk2-devel] [PATCH v1 1/2] BaseTools: Fix crash in ECC when parsing incorrect header Date: Wed, 16 Dec 2020 17:05:05 +0000 Message-Id: <20201216170506.13313-2-Pierre.Gondois@arm.com> In-Reply-To: <20201216170506.13313-1-Pierre.Gondois@arm.com> References: <20201216170506.13313-1-Pierre.Gondois@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: Tbm37nJb5cHIGBGzEPHsMYq9x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608138502; bh=BxCiRla4St3TQge9Ba/Ve5hO271PD1M+U03T5F2tiiY=; h=Cc:Date:From:Reply-To:Subject:To; b=DQYGfV2qsQRPRERdtYbFoW5k4UCUzJ6bpP2rXicvHJnsihW5FZuQ73fyYKLG/E1Yzs+ 9ffO2GfH2IvPjpm+H0llagTIQj3splAkF++VZlMChRp3bqIgdC55IGMVNs7t2fEnfL+E4 4Xe0HipY/7Unbe+IK8HBeRrM2/3Jc7MYcUI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sami Mujawar The ECC tool crashes if a C file has an incorrect file header format. The file ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuPeiLibConstructor.c has a file header in the incorrect format. It uses # to mark the header comments instead of enclosing the file header in /* */. This may have been a result of an INF file header being copied to a C file. A separate patch fixes the C file but ECC tool should not crash if a file with an incorrect header is found. Therefore, update the ECC tool to prevent it from crashing if an incorrect file header is found. With this change the ECC tool will report the incorrect header issue without crashing. Signed-off-by: Sami Mujawar --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1551_= Ecc_BaseTools_v1 BaseTools/Source/Python/Ecc/c.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc= /c.py index a30122a45f81..db686df0db25 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -2,6 +2,7 @@ # This file is used to be the c coding style checking of ECC tool # # Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, Arm Limited. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -64,7 +65,9 @@ def GetIdType(Str): Type =3D DataClass.MODEL_UNKNOWN Str =3D Str.replace('#', '# ') List =3D Str.split() - if List[1] =3D=3D 'include': + if len(List) < 2: + pass + elif List[1] =3D=3D 'include': Type =3D DataClass.MODEL_IDENTIFIER_INCLUDE elif List[1] =3D=3D 'define': Type =3D DataClass.MODEL_IDENTIFIER_MACRO_DEFINE -- 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#68981): https://edk2.groups.io/g/devel/message/68981 Mute This Topic: https://groups.io/mt/79005705/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-