From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by mx.groups.io with SMTP id smtpd.web12.57.1600812778368246430 for ; Tue, 22 Sep 2020 15:12:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cFTn+XGm; spf=pass (domain: nvidia.com, ip: 216.228.121.143, mailfrom: jbrasen@nvidia.com) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 22 Sep 2020 15:11:23 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 22 Sep 2020 22:12:56 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.105) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 22 Sep 2020 22:12:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bw8Gr7shNDpLnSVGMV7dFkRpewQb+ILGJ4GPCa7aMnVGZBbEVpuy1s4127cu7To4yTuxKq4K9b+3NH30CBSOl2j8R2qaJOynTDWyK5+v5ew26RPxMUY+c9Q/9f99HeqI9H8RVw6PZyj4dZyq4t9bOqoulJpbdM2FybDuxL0nXXIfLJa+OQm7SodJv1RkhAX5B/Pv5lPej32PDba1rBjuGJCbljZb0a6UaxChBCuo/q2g3WDxaB6FwmRpALKb0ZUf4+GwgSI/bMIHh0emLvu27hUs9QCYBOBEIve/hPSmE4CFkw7EfhoVUxQwYZJ5Hco74ce0nyLDN/PHk6dX0+MmZg== 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=21DHWhbuf9xn3bjw2cgULybfr34Hu6P81eDIG4cdt6E=; b=dZxI5xe1dP8SVKiTTO2leQE/JAXCvMXyGCLVx0vVlnpd/5bsvA1Ef4r0EN7dvtgtjyU2fSdAyVsZqMV2wzk2gbglPkd0ircXSYa4grBU8GybFUPsR7/djl+jEyhQrTalxLPlRr67ZoffoDcU8BjVsu+D79RpTVcxwx+yNYr9e0Ja5pt6pro2Ll45CLRpAy/3tYc5P/GFH3hpXWd3bpsExPXUECmfrLrBE/GVLgiddb3TQfpTp3IkW5k8UZqOayvqYAc9sHCaANythie7go8V3luIXSUXKLySwj8lIMWUJUHVrzjbWddqom2JDvDJHtqiO48C0q7/xubfwiStLZK/Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB3340.namprd12.prod.outlook.com (20.178.199.88) by DM6PR12MB2874.namprd12.prod.outlook.com (20.179.71.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.24; Tue, 22 Sep 2020 22:12:55 +0000 Received: from DM6PR12MB3340.namprd12.prod.outlook.com ([fe80::1876:2f8f:fcae:4bf8]) by DM6PR12MB3340.namprd12.prod.outlook.com ([fe80::1876:2f8f:fcae:4bf8%5]) with mapi id 15.20.3391.025; Tue, 22 Sep 2020 22:12:55 +0000 From: "Jeff Brasen" To: "Bi, Dandan" , "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: AQHWiF5IuMdD7BysfEi0/5U/9PLfCKloMlsAgA0Xx0A= Date: Tue, 22 Sep 2020 22:12:55 +0000 Message-ID: References: <0cb9d71f50baf3c98522b5d20e4083da458050da.1599843970.git.jbrasen@nvidia.com>, In-Reply-To: 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=nvidia.com; x-originating-ip: [2601:281:8100:1241:4d79:4253:57e4:4cb5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a5bf0ff4-aa04-4eb6-b17b-08d85f44a827 x-ms-traffictypediagnostic: DM6PR12MB2874: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SmYczjlloju5XvwXPmb24mU4+eCzRwqqGTIENT6kExopflehtgUfyZTxbcsSXgW7JmEsjj4hgZZxqseNe5R/zNXKS0wx0iy255SdW4boH5VItQlzeuY1LzqMONvXqklH0gORSnmCNQi1Fu4xgFZnWLiZov91ZgGmo2cEgum33qbyPf18vPR3MrDvBrdqTf8Lz72UfQGXBSzjlRIPb1HFV3voA1+BKfCMsgU+uYxhtW5Mz+GSHjtsLl6S4LrJn1i5hn/si38/QCftvKap0T4svACaBhVM3IDVM0K1ciqtm1piZN4UynS4jvesZ4wyjzzk x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3340.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39850400004)(396003)(346002)(366004)(136003)(376002)(71200400001)(316002)(2906002)(110136005)(19627405001)(83380400001)(55016002)(478600001)(6506007)(7696005)(52536014)(66556008)(66476007)(66446008)(66946007)(76116006)(64756008)(4326008)(9686003)(8936002)(33656002)(53546011)(86362001)(5660300002)(8676002)(186003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: V2HAQuaca6G+dq/+jMuYqBFBuMUJVWxiDJ8Hc+leZHakge6Y1Mm7ZJGAlyxQNny6UT0qhbvnBkuggosmCzN+mU8YdLJZnoiqxdNICEkp5K5Z1ExrBLa+xGSX4gbbu3r6QcgxxXr/Nh8VktJCJDFmgdyZq+Jo8mkaLB2GRGjf0NTZc0+xL+c5ZlbObFEyIOF7ULFdYF7suAVnQRzp7vZc/PQ/54AAEZYURAz7/sQSwcZAV2Z5Tdhqh0nItSlR2fUuYg+9tg3eqks9tc7xiuA8+6/zAf2XJ7xlwkkqcxGlJEbvO3N1xSq3T03mnELg7KLJuGjBC7MSp5Tdr0VY5k2TmIG7SF8IcmosudfVoIYfWXgqWLdQIkCVX8yYLexyOBxxyli0IFp3W65JEXoh9DJefxg2ZugvD+kwv+NEKO6je6aXBQLbogu9/6zmawBawHKcOclgTvIRCy9Glr3athjDqWGD2FaKiQXMvrcUla9pHHM2txX4vVOMi7nsn+EuAf/rg2+cGmFjGHf5BCCZkeX/yvP7xH8sPBZgz682q0Xz6cuTOx/WGysrI8uIBLh3NUrnoVWCh0Al5T1h9O6hy4eYT+EIStWjuEqm5zkfQL4CbVWqqIEMXCcro2Oo6b6l5d9UKKkClYxqhPciJckfghJE592qNh3o8w6QqUOIXdkdYXZ9yamBtaTYDc1H292kJCdsKTpYCVPG8XszXZrzTp6S2Q== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3340.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5bf0ff4-aa04-4eb6-b17b-08d85f44a827 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2020 22:12:55.4754 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Guxo7ms+OtbqlgncTGaE2mzDJqCvzu7wwaahQFcfKgP8k920FxL+gteA+3uVEr+ohKusUY26wJsIArpJksWAcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2874 Return-Path: jbrasen@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600812684; bh=21DHWhbuf9xn3bjw2cgULybfr34Hu6P81eDIG4cdt6E=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: x-ms-exchange-transport-forked:Content-Type:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=cFTn+XGmIhGWhRjyQxCmdVHZjO8rwXZtbWIL0lT9YGKpJ4P1tM5AUZPUfvIHVTLaO uiRT5VWQHdGb9odDHX8dPzBI6YVPtlXrzSyzdujWlZ8hMyPGvpmq0tIPZwiGqaRB/L gxamqyrmH0BKCpUSoo6eZSTenszVfnTPJVTQTExcFnU8+dvgrzVA4u7hhlJC4548M3 FKU30r9g7zdSfn1EkvCZs/pn6+qgZ7cQyfZft8cWVnjuTp1PUCpKbgT+axDPkTtd/Y kBZtN93a5gkx4aGpg8zJLBm6rhMprGF/IBWOkO4L5/f2U2zUV0T5+OG91HQzRwqZvJ J+msiriYL+1Zw== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR12MB3340F52A01E7EFC7790FDFBCCB3B0DM6PR12MB3340namp_" --_000_DM6PR12MB3340F52A01E7EFC7790FDFBCCB3B0DM6PR12MB3340namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Dandan, are we waiting for any additional reviews on this change? Thanks, Jeff ________________________________ From: Bi, Dandan Sent: Monday, September 14, 2020 8:15 AM To: Jeff Brasen ; devel@edk2.groups.io Cc: Dong, Eric Subject: RE: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string External email: Use caution opening links or attachments Reviewed-by: Dandan 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 > > Update function behavior to not modify the incoming string that is marked= as > CONST in the prototype. > > Signed-off-by: Jeff Brasen > --- > .../Universal/HiiDatabaseDxe/ConfigRouting.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > 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 --_000_DM6PR12MB3340F52A01E7EFC7790FDFBCCB3B0DM6PR12MB3340namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Thanks Dandan, are we waiting for any additional reviews on this change?

Thanks,

Jeff


From: Bi, Dandan <dandan= .bi@intel.com>
Sent: Monday, September 14, 2020 8:15 AM
To: Jeff Brasen <jbrasen@nvidia.com>; devel@edk2.groups.io <= ;devel@edk2.groups.io>
Cc: Dong, Eric <eric.dong@intel.com>
Subject: RE: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST s= tring
 
External email: Use caution opening links or attac= hments


Reviewed-by: Dandan Bi <dandan.bi@intel.com>


Thanks,
Dandan
> -----Original Message-----
> From: Jeff Brasen <jbrasen@nvidia.com>
> Sent: Saturday, September 12, 2020 1:09 AM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Dong, Eric <eric.dong@i= ntel.com>;
> Jeff Brasen <jbrasen@nvidia.com>
> Subject: [PATCH] MdeModulePkg/HiiDatabase: Do not modify CONST string<= br> >
> Update function behavior to not modify the incoming string that is mar= ked as
> CONST in the prototype.
>
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigRouting.c   &n= bsp;     | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> 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        = ;            &n= bsp;          Index; &nbs= p; UINT8           &= nbsp;           &nbs= p;       *TemBuffer;   CHAR16
> *TemString;-  CHAR16       &nb= sp;            =           TemChar;  =   TmpBuffer =3D NULL; @@ -
> 5564,10 +5563,13 @@ HiiBlockToConfig (
>    //   // Copy <ConfigHdr> and an addi= tional '&' to <ConfigResp>   //-
> TemChar =3D *StringPtr;-  *StringPtr =3D '\0';-  AppendToMul= tiString(Config,
> ConfigRequest);-  *StringPtr =3D TemChar;+  TemString =3D Al= locateCopyPool
> (sizeof (CHAR16) * (StringPtr - ConfigRequest + 1), ConfigRequest);+&n= bsp; if
> (TemString =3D=3D NULL) {+    return EFI_OUT_OF_RESOURC= ES;+  }+
> TemString[StringPtr - ConfigRequest] =3D '\0';+  AppendToMultiStr= ing(Config,
> TemString);+  FreePool (TemString);    // &nb= sp; // Parse each <RequestElement> if
> exists--
> 2.25.1

--_000_DM6PR12MB3340F52A01E7EFC7790FDFBCCB3B0DM6PR12MB3340namp_--