From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.62317.1600092959040788747 for ; Mon, 14 Sep 2020 07:15:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=AE7Y5swJ; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: dandan.bi@intel.com) IronPort-SDR: Lx7aL2Oadp9s6nZLaXpE9qR3L9NSQa9QRzOQtoWXhKC2w7CeeU0mc2oh/ysZsoHBAe+EXh5QgJ l1BQPA1LJu3g== X-IronPort-AV: E=McAfee;i="6000,8403,9743"; a="243913984" X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="243913984" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 07:15:56 -0700 IronPort-SDR: BgIHk/pPjWTmbZafYEedfvrAgy1TtdqWlA57pmgaXjkqysF4fL+uPv05Mm3cz9AZ1e91G25xwP LSjkt3e4tqWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="507158595" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga005.fm.intel.com with ESMTP; 14 Sep 2020 07:15:55 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Sep 2020 07:15:53 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.1713.5 via Frontend Transport; Mon, 14 Sep 2020 07:15:53 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.54) 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.1713.5; Mon, 14 Sep 2020 07:15:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Di1eq/IKTMdZTAmJ9UczqBXCIKVv/blbw60y6wNlHHhB32bCEGbP0b9z25I7tQcMBJAqkTv/iDoJVIF/+fPeV3yABKY52nG97uvqexmFaPrkdIF1e6IIypm9d4u4q+Nf34b0u7nDuDe429Q1P2Pw36aPYaNaLAWmA0IMESXk/YohXCXH/qKNjdbyN0B3XTqtzmbdCx3WMXza0E9eOfg2tX1jlEGVXCFsPZ4/Fi6MrAwJwMBOwLiG5HIrngiPc0wEywDYktdxc5XdQpQGo0aZPFSA/D7QiZFDwnbSh9PvGoNbfIBbyV4/iU5ddl+d6SSU564hNCJF1XTfzp04Afe6+g== 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-SenderADCheck; bh=BHVxI11ab3F3UDFMc9zssV2UTWAiiyXzWrCTqG4X7e0=; b=LV5rFWN4GFQsLnjYAq1Cr2RhvbFar/M1sCk2tbVcNUj7jAilnx66DB3X5n62ZZeWcrtbJTjRCt++faRg6kqfaeoO8XqXVBVN16FiHJLjtWhbnTCfok6CK67n2Qy7ZfZhNjsgj6qvb+s06i2tTDZmh/skUvvXWl09NIRm/LPtSnTxVTHHkGI9Z/Uf7BgJtpO7vokSdjMpx2wsPRb+mIRHvKT7D9fWyZjR94NTr9VLNdlxas+6iwA6OzerVHaJfHcPnna6fxRcPmfLJqYM8eJRePExzrnnpQcRwkEiFWacYnsP4R9h6qhI4fq4Dg5Em94HUVaAKNnlUrjrryPeo88kzQ== 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=BHVxI11ab3F3UDFMc9zssV2UTWAiiyXzWrCTqG4X7e0=; b=AE7Y5swJoRMYycDUTbXE8Zcr+ExhzNqDSaS+McS1/m89y7RrmsaMCcSVJlHWLDcWENnF5wVbfdJ9ECUAD2UWwjNCuwa6KS4/M0aXxjNuXU9zatIVhQ9qRykXb9viUdJuIpA7RYBGTFI+nrb0SYOjmyaGuhYxxdt1iY+L/aE4ZWM= Received: from BN6PR11MB1393.namprd11.prod.outlook.com (2603:10b6:404:3c::12) by BN7PR11MB2706.namprd11.prod.outlook.com (2603:10b6:406:b3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Mon, 14 Sep 2020 14:15:50 +0000 Received: from BN6PR11MB1393.namprd11.prod.outlook.com ([fe80::253e:c7af:e716:9ecf]) by BN6PR11MB1393.namprd11.prod.outlook.com ([fe80::253e:c7af:e716:9ecf%3]) with mapi id 15.20.3370.017; Mon, 14 Sep 2020 14:15:50 +0000 From: "Dandan Bi" To: Jeff Brasen , "devel@edk2.groups.io" CC: "Dong, Eric" Subject: Re: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string Thread-Topic: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string Thread-Index: AQHWiF5JE1gab+Zdgk6i4pD7DKXRCaloMWHA Date: Mon, 14 Sep 2020 14:15:50 +0000 Message-ID: References: <0cb9d71f50baf3c98522b5d20e4083da458050da.1599843970.git.jbrasen@nvidia.com> In-Reply-To: <0cb9d71f50baf3c98522b5d20e4083da458050da.1599843970.git.jbrasen@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 52043200-0adb-4e67-b46a-08d858b8af10 x-ms-traffictypediagnostic: BN7PR11MB2706: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2089; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IAd0j8sdQN1PuRnGMPUoVtZrDdmTCatG0gj+dpQbT+tdmCXIUrrLEpyeh5WahymnB3tuHHlQmt5hBObwWRaxPdpM2Yf9YU3PojqpkhZ7OyYu/CYp5JKBHVdWJ8f2ArFnPuvDz1pdpZJNXV3y0ZW9rXAfEorvS62XuWleLWHHNjZM/9gpHb27sF9Ayjg+ib8t1zh7Gjuj6bPTHOj0DeGRmUCimDEPbFYoMB77DLxxPjLHJUNROArqUTVAixO/VICsLvXkrQNVnBxAuRf929earWWU7pcppF5tJcnAYvVu1ZdsWFMWE2+HNEpL+82tca+G x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB1393.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(136003)(366004)(346002)(376002)(39860400002)(7696005)(186003)(2906002)(6506007)(53546011)(64756008)(66446008)(66556008)(66946007)(66476007)(55016002)(9686003)(76116006)(4326008)(316002)(107886003)(478600001)(52536014)(33656002)(83380400001)(26005)(86362001)(5660300002)(8676002)(8936002)(71200400001)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: vrt0pTeOAxBuTwmOb+asoOjfbCeyT+5gu6hCxvOEyhY7k3rS6PvCwOJEAkbRihygCq7lGchU4U9dI/h3kl7wGG/kKFufSH4s7V8S6YN6h6QvVrpYEVx1ZrvWutfsVeNgy21096LeCUV8wUFQsQQpOlEnyRjTK9IPQIROWsOmC/mmyrdt/Hz2o3m0X7TM4ckfINaV7EDReuwHhZu4dl9oxU4COV0LsDYhLBn3pgTtBHHFRJK1wNKDHJVONtWm4zD8HMnnmc5ea+lgCL/og60jkpp9S+Q1hjHuxM9PFvkf7L+Hz4BpbxsW+fO4rB/xNNF92OdJxeeGsw5iN8ySeG4S5quHVxkPipkpDEbfopd6S/SbrpPP92rUvysLjCHxdJyOFk4dISoS62/oZJancbmLGS0L3QFzhVKpmLMjLw7Iykj/rdj3MOQqFE+cMAodQFuddhPCmvyI+KpM9n0huIFUYyPtjsRPo/mEkHCvlUf0v5lb+8fU8d2izuwLNiRqZg0oGiun0c0q2R5gsMXx6cgc/1Kk3roo7GA/w9H4/Hk+t+9LBHljTwaA1zXmJ9crGEmfioVpH1eEfTlV6J3Yoe+/s2a64I6pv8NMrZ4eZreg8w5at6IY519tatzhTFHMzHfqYVu2o/18rzqOCaIrI6f9ig== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1393.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52043200-0adb-4e67-b46a-08d858b8af10 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2020 14:15:50.5590 (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: txGuacn+qhOJtrF9Znv0juYYU6wvgFS60PLWA2wClhy9aFwus0vJDe/BlEjhj0qTtsEnYHrEOyTHhJKmUMYIOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2706 Return-Path: dandan.bi@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Reviewed-by:=A0Dandan Bi Thanks, Dandan > -----Original Message----- > From: Jeff Brasen > Sent: Saturday, September 12, 2020 1:09 AM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Dong, Eric ; > Jeff Brasen > Subject: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string >=20 > Update function behavior to not modify the incoming string that is marked= as > CONST in the prototype. >=20 > Signed-off-by: Jeff Brasen > --- > .../Universal/HiiDatabaseDxe/ConfigRouting.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > index 2cad6d29f4..d492b769d5 100644 > --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > @@ -5497,7 +5497,6 @@ HiiBlockToConfig ( > UINTN Index; UINT8 = *TemBuffer; CHAR16 > *TemString;- CHAR16 TemChar; TmpBuffer = =3D NULL; @@ - > 5564,10 +5563,13 @@ HiiBlockToConfig ( > // // Copy and an additional '&' to //- > TemChar =3D *StringPtr;- *StringPtr =3D '\0';- AppendToMultiString(Conf= ig, > ConfigRequest);- *StringPtr =3D TemChar;+ TemString =3D AllocateCopyPoo= l > (sizeof (CHAR16) * (StringPtr - ConfigRequest + 1), ConfigRequest);+ if > (TemString =3D=3D NULL) {+ return EFI_OUT_OF_RESOURCES;+ }+ > TemString[StringPtr - ConfigRequest] =3D '\0';+ AppendToMultiString(Conf= ig, > TemString);+ FreePool (TemString); // // Parse each if > exists-- > 2.25.1