From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.5323.1635829847621256866 for ; Mon, 01 Nov 2021 22:10:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=IM8UWDh3; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bob.c.feng@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="231040121" X-IronPort-AV: E=Sophos;i="5.87,201,1631602800"; d="scan'208";a="231040121" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 22:10:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,201,1631602800"; d="scan'208";a="666978132" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 01 Nov 2021 22:10:46 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 1 Nov 2021 22:10:45 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 1 Nov 2021 22:10:45 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 1 Nov 2021 22:10:45 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 1 Nov 2021 22:10:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VpaM5o6eQ7gLx0cK0YBE6eeyDYufjCbtBNABDDD7p03cfMq8VGqPI72k1k4o3bg1gu7Z3gLy+Umwrcv8m/u1yPAVdRP8c2d/J9aK8PPBXhRBoyjV7jxfeTlRyDC5UjIMEci+BgTBqGQrMAhlkFoLDrzdNcXVWogu7QB8GWHQepFNRAqKGym6U9F8s//D0t4B/bijxl06WlQQIZFjaZ10bhvRXjJLH360E4yco18VnAAct5marDOVGpmFKnAQ9o7FoDpqKQHVDV4xy9+k4BqFT7p/WX9rGk9rqTKLdgI93t/DBR/NN4+Wc6uZKVAaKiZ+DycjmcNkpZKbgTGdictI8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mLZKYn5MI0QI4v8XUCAnorPSxDz01p+rNGShurrO6EI=; b=WSIuqs2VpQqUjjWd0a8wwexjWKNuIwU/VMWNLJsP7JxiTvZMBgJPu1UTfJNAy+6E26Ad4S3GRGgAjowjZjEif9jJ9vbG0AYkAlhfaoWSEF/P5Dj9RcHAfvVSKsAMugDL3NpS73Wt6IUXutugVlDuqtzlALbZO7IVW5cMluJuNwJ2QpULopdRRCBqIlFrNcJivoNhrDw7bscJ7GfjXx5ETScGCWvYo3mVt5MKVrDlMvOUfDNRcfxMokltVt7D65RsPV/RFCGR6oaT1XS+Qn9CX66MZWV5wBgFdIPnSn6lb7d48glJ4iXpQJ9a06gqNyVWKGp51c4Qh+J9axa/tl8tqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mLZKYn5MI0QI4v8XUCAnorPSxDz01p+rNGShurrO6EI=; b=IM8UWDh3bIf62Q9/9KdTxqguN2fKqN+iKrKN0fsKnfcos9ujxkZQrOrxoZba6WDSErDgsOPyt840TVVGvf18tDawd4kEQwjVJUikEji1VLWBhy9gefcZdI+HSckF1yKzqkXz2mta/BVSBqhU3QITYaStjtbvH+kHA3NYjCLUG/4= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3196.namprd11.prod.outlook.com (2603:10b6:5:5b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18; Tue, 2 Nov 2021 05:10:44 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::85d4:9d42:234a:6b4b]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::85d4:9d42:234a:6b4b%6]) with mapi id 15.20.4649.019; Tue, 2 Nov 2021 05:10:44 +0000 From: "Bob Feng" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Liming Gao , "Chen, Christine" Subject: Re: [Patch 1/1] BaseTools/VrfCompile: Fix uninitialized field from unnamed field Thread-Topic: [Patch 1/1] BaseTools/VrfCompile: Fix uninitialized field from unnamed field Thread-Index: AQHXz0gpnUsnThbewU6+2o+6j6sCKKvva4/A Date: Tue, 2 Nov 2021 05:10:44 +0000 Message-ID: References: <20211101174431.179-1-michael.d.kinney@intel.com> In-Reply-To: <20211101174431.179-1-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1c2ae51f-a7a7-4cdf-f585-08d99dbf1f92 x-ms-traffictypediagnostic: DM6PR11MB3196: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2vsw5X2vKSJovR/Ek5+KNK2DMLOsbpfCrHgGuqNxcLLCrL52Xgen12Q64diqc++qIuR0O1Y8aOKrqAwk60qRq4aQ9VfxUBLVwXP7CDd6LiGDquCWBBb52+AmsvcZGg7PZR6DBd7VN9pcoakD3HRW5h+9DXsF30/ADmM4JT7GBtlAMF6DvO+nIR5K5CdHR3iJXrYkjpRk3kcr+zIUdx3qYVLV0u9btbK6ZbLjQRCAGQ9lILhYDXOEjPz5nim63aSeqqlhlLcuS+qTaxsSUnfuGYF3HvGfMJDcB34CKlZe5i1rMjSdneDJex4QLLGoAZRTEY67hUpJKvpJtWMN4Ss4AZMfUh/pQaYZ0l5nXk/ygzt1CBlUdfcTwmnki04pt1Xl/TiOhCK4MNO45X5cvjckpQnhaGsSUKcg0DdcglQZv+NllZIL2D7T11I19Ag4miXeO7qiIFdeQj/FH/bknrzRC0yxbuR22sxhbEJ2TJRFGGyxP8gTzsZg/DuySnr8lMLTTUVeJCVwih/EaVCImjDUC+6OTUqXRFsj5qWkTyADOwuh9eGydtEtGH+uz7ZRQQxk79QjBVmX38wIVg/i4Jore/sP+o6fm94MmoH8WGsijjZ5PCMNTe+QyFWufa1mad6DB0nDWjgME7aFhs9xKn7hZcWY8w0TNLBzldhQKYyttt/GwaJwE2a7Mt33bTGVR3+PSlCu8Usw7qQ6OlMGfGlvE5sODMnuVZ/kUR7jQOuczX3NOr0ccHeaQxaVEW9+56oDii6yNw7M8IDo4Mxg53UUOHttgX37815yVvhgnytkVNM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(107886003)(38070700005)(52536014)(966005)(122000001)(4326008)(9686003)(55016002)(2906002)(5660300002)(38100700002)(33656002)(71200400001)(6506007)(54906003)(26005)(186003)(53546011)(7696005)(8936002)(82960400001)(64756008)(66476007)(86362001)(66556008)(66446008)(316002)(83380400001)(110136005)(8676002)(66946007)(76116006);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?A8RULRe6Bn+ixxgEFcQD4IGRTtKzXaDoJNmw67VGZSdmhqeSHg5USZJwQETA?= =?us-ascii?Q?33z0HJcW5dwHM+dJF8OotY402ZTiaMpkSAVbaWanjX1igSAXXuIPOI9KV+eU?= =?us-ascii?Q?ZAJvDMjaUuxWFi/GHKBUS229Klt5njtUsTja1lsYdvbuBg/LXpNHkgWIlQMX?= =?us-ascii?Q?J/+bAMWF3Ry5B1vozXNb3NC+RG8dEcc7T57+Ov5URpdvUjQ/8jyzQ0UJJBsN?= =?us-ascii?Q?2xi+W92VJqgTsfHeiree4KsVkFvYFiDu3/j3GmDe5MyWjq4CuOnEVDfEYScc?= =?us-ascii?Q?5mqcGutquwayWLjPyv/JFDf0CPYwytGQRMLcR84H0/BV7hBMWJaTQhHWKfbQ?= =?us-ascii?Q?By7ytajYX0NmFMjgqspoW7ilDZa/h2FECyaENk3eD4ajrWqLTP+NY2MYHOvb?= =?us-ascii?Q?wBPv4My+K+C7LPU391ZFJKD+beHi/IUts0juBu1oa30XPPJW7InMghKd0P4U?= =?us-ascii?Q?llNkY/4cQNaCfNwZoMn7aFDkqRTidL5emYgakVAep6n4/0nnX2xL/vueW3S8?= =?us-ascii?Q?B3VTHF2HOlYCV493+3Qfg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aALEHAIQoG8?= =?us-ascii?Q?b75rtfPTMyH57n9hHzmh/v71uf87Ih+2Sq9K45b09vnm6exs6kFDVUlnRyJR?= =?us-ascii?Q?vyErX9uyU2Wytj8IiB9eBb9+xljjcmC75bRqlnTTCctMN5toM1nHhaz2/k6F?= =?us-ascii?Q?naagIfkbuQvDxSzX0bt9ojzFq0+QpvKWVAyKWv+h3g4RpC51lStGpXo8PVNx?= =?us-ascii?Q?4RcsZIo62UwMhMn9kfIjtW0=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c2ae51f-a7a7-4cdf-f585-08d99dbf1f92 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2021 05:10:44.2215 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aZNY0YlDyRqmVUwvhUViGJu7wUpMAMhS6WH3TDnxgb89NfXpI4yzDG60XIY1V9dSHVPwtD//f/MRSkTgnKXEjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3196 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is good to me. Reviewed-by: Bob Feng -----Original Message----- From: Kinney, Michael D =20 Sent: Tuesday, November 2, 2021 1:45 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao ; Chen, Christine Subject: [Patch 1/1] BaseTools/VrfCompile: Fix uninitialized field from unn= amed field REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3687 If a C structure parsed by the VFR compiler contains an unnamed field, then= mFieldName is left uninitialized, which generates random data in the VFR c= ompiler output file. If the FieldName is NULL, then initialize pNewField->mFieldName to a Null-t= erminated empty string. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Michael D Kinney --- BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/So= urce/C/VfrCompile/VfrUtilityLib.cpp index 2b9b5dbb1ca5..11470de45cce 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -1135,6 +1135,8 @@ CVfrVarDataTypeDB::DataTypeAddBitField ( if (FieldName !=3D NULL) { strncpy (pNewField->mFieldName, FieldName, MAX_NAME_LEN - 1); pNewField->mFieldName[MAX_NAME_LEN - 1] =3D 0; + } else { + strncpy (pNewField->mFieldName, "", MAX_NAME_LEN - 1); } pNewField->mFieldType =3D pFieldType; pNewField->mIsBitField =3D TRUE; @@ -3916,5 +3918,3 @@ CVfrStringDB::GetUnicodeStringTextSize ( CVfrVarData= TypeDB gCVfrVarDataTypeDB; CVfrDefaultStore gCVfrDefaultStore; CVfrDataS= torage gCVfrDataStorage; - - -- 2.32.0.windows.1