From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.29378.1595207738754188134 for ; Sun, 19 Jul 2020 18:15:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=SNX5hbiO; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: dandan.bi@intel.com) IronPort-SDR: NQOmscISWlRIBklSdhL+kCCtHmQzYBWTXlcH5QjOXR5yb1GQbYfms+gTFmcuC6Wb01SVLSSUBu JPySzWL/gb0g== X-IronPort-AV: E=McAfee;i="6000,8403,9687"; a="148992436" X-IronPort-AV: E=Sophos;i="5.75,373,1589266800"; d="scan'208";a="148992436" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2020 18:15:38 -0700 IronPort-SDR: fUbumrU3Vt9G+AhHL8geFloXTWt6ZdcxpIkrlGjXB5QCN3gvrxZImXxDnbEcuEgaqEfUDlfRtU wroKW0Nd9x9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,373,1589266800"; d="scan'208";a="301126398" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga002.jf.intel.com with ESMTP; 19 Jul 2020 18:15:38 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Jul 2020 18:15:37 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.59) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Jul 2020 18:15:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mm6jd//5FeMjYFts64jjLHh1etx6aqeqt2wySiApeKEAM+ZrFCdDbRTuFFUHjDwYIHfbGllYn0XeUijRx54ByuJV5R8XiatS33m4Q9EolhE7k/ksLg5HFanNi3pQDjR4Lx5/eKOjplpeht7t4y9sYJFuKReQ57mTIOeacuEtjsXJuJ+oE4dGgktUp9WkX03kQmPfz1xp4MAl0l33P4A5x/m60tO7uuzgg0cn/QkUYMpcYVPVFYTVU9t+Om4rN5tDzC+IEy5gEKdCqGNjz/T/vqYw2YT5kyupM9b99rFBgSP5T4JJoxfULB1jPK+ec6LyCjG11XSozxrf8rXIp1YVkg== 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=8fu2zyIq7WnlDtNlVO7mb+pJOMK/gxj35bK/6TVWd4M=; b=BlTG67AEnnJtcngpcUP5lgXK75LlBTQc/2quMWke052dr3z0HoxfKQ/YKxCjO3DKz0VhzjCwNbeSBvC1XNf0+j+4nVyV28eqDrrhQttwOZO2MpgAxLjVyqAkSJhS/B2l+xbBv5/2u3u8LkFGuIAN+eFzdMUsRN/+dtmh6OSatTV/cFteZPrd7cBsw93pIvsfq1x2sgFwcdv+KKnPPOcjuRzydiK2/vUT99q9ge6bycZ46z5ruDVaf8oXI1M/WDyizsEpvuleadsFrLK+4Wma8XBLHGdh8v+SGfcD5CWnevMhb4hUrf516ZmpvECkTPqCUpHcAn3T7kqr+H0eE8mYAA== 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=8fu2zyIq7WnlDtNlVO7mb+pJOMK/gxj35bK/6TVWd4M=; b=SNX5hbiOyK5rGwoaglU4AWDNik80WqBXYBPqnSY0Eeznq3CTyjfj3/k4UpevlTcYU8dXC1ENFVQzo/frVgSS+45WDfhkG2zKPnplUcVtvNiLQSxeGQcH4J8Wz/7lFlTKykqebdpDtKq9VInWPGZnH9lEO4LlgFIU1G2CEcrj/ug= Received: from BN6PR11MB1393.namprd11.prod.outlook.com (2603:10b6:404:3c::12) by BN7PR11MB2866.namprd11.prod.outlook.com (2603:10b6:406:b5::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17; Mon, 20 Jul 2020 01:15:34 +0000 Received: from BN6PR11MB1393.namprd11.prod.outlook.com ([fe80::a1f4:15d6:9a79:de03]) by BN6PR11MB1393.namprd11.prod.outlook.com ([fe80::a1f4:15d6:9a79:de03%11]) with mapi id 15.20.3195.025; Mon, 20 Jul 2020 01:15:34 +0000 From: "Dandan Bi" To: Jeff Brasen , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH v2] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Thread-Topic: [PATCH v2] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Thread-Index: AQHWSMHYM4PbRuVqdUOh9wKol2tgaKjm/VtggCVn0oCAA28pAA== Date: Mon, 20 Jul 2020 01:15:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=jbrasen@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2020-07-17T20:46:27.4413940Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=edcea4fe-3e98-44ca-84be-4981ef817c6d; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic 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.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85b2d57d-cf01-4dbd-b066-08d82c4a6744 x-ms-traffictypediagnostic: BN7PR11MB2866: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9hFUVoizlRzPmkbLkGzNAA9mc8/k10D5hFOZUdgnJ3+scc40rFgznrw5OJPYMSKpelkGBQAvyrnSaroE9PDLlr78PwXP2QjRr9HiYXcEzlHAhhNmmt6Brfo1Y4X83EUewFnO0V4sc0mmVC4L2k22d7FF9lby66+9e8RXxVeCXKVHZpjffKTJ7hSwfY23PYD8t2zlYBuGZmQqzGap8+9ZFPBC7tE0iZtU0PEPlBUB1BogK//WOFAylgTxePr1BEvlkW5o13az/prhJnvaeT2Pjll4iGVmrGr+wjFvmzJtax21FcYmyl0ecBhIO9z11V5rjjtWkz1XDvDjvQb2+UXLXaGrpXoURtAZu6lnCk8KZmAczRbIleOTS9ekLoLQmQ3S 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;SFTY:;SFS:(6029001)(4636009)(376002)(136003)(396003)(346002)(39860400002)(366004)(26005)(478600001)(2906002)(8936002)(66946007)(5660300002)(9686003)(66556008)(66446008)(52536014)(64756008)(76116006)(55016002)(66476007)(53546011)(6506007)(86362001)(186003)(107886003)(83380400001)(7696005)(316002)(71200400001)(8676002)(4326008)(33656002)(110136005)(145603002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: MvIyn9vkn+bdro1AkSSVax3/jjXRR/9PXGibKyEO7tOTBowtjdYzePJkVOd5xvSLH/Yi2kwahCskT+TGl4qlWG5NKXs/Megu6ELG1aUtaRQheZvGaya7oOkuk5befay34k9TgW8bHfJraMx83XdNuT9BI8GYclatmdttPAhV1bGtFELn0NBtYcXnbyGuU76ijXAhS+ofLlw8dTqmOO64OHxgVjaS0oDhpKTTWVhe+A59O6KBgPjrhO5uRC1xEtaNr5E88UjY49Zxkd8UCu/6Efr3o0kVWLYbQ7ja2S/FKD1hHp4U8NKk3Kcr9aCsa4dl2dxiYTl8PdDvHiIadvMnx/0/GAi2Mb/p0JrkhkoTJxDudvuB1lpKaFRIIuBhSXpaCXet0r9CEAQaSsIwXN3fif8y8DDWDcCJk3tXq1SbcVHD+4RYzSWbzDXl0ZdSjrhyof4h4C845HUWlyO2kD5VT8RG7DCjleyPafr5R6tgmaKyvkGhdQ9Gvb+CwXXZ2Oow 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: 85b2d57d-cf01-4dbd-b066-08d82c4a6744 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 01:15:34.2722 (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: i8LbnsCIuvqCcfQZMTU+Xv/ZfSQG6ITNjhQN/DZRnDXeykh69/Wh9t/JQRE2HXWbVBPPjTGnP9ppqlvBbfJtKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2866 Return-Path: dandan.bi@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I will submit this patch before the end of this Tuesday if there are no com= ments. Thanks, Dandan > -----Original Message----- > From: Jeff Brasen > Sent: Saturday, July 18, 2020 4:46 AM > To: Bi, Dandan ; devel@edk2.groups.io > Cc: Gao, Liming > Subject: RE: [PATCH v2] MdeModulePkg/DxeCorePerformanceLib: Switch to > UnicodeStrnToAsciiStrS >=20 > Do we need any additional review on this before it getting submitted? >=20 > -Jeff >=20 >=20 > -----Original Message----- > From: Bi, Dandan > Sent: Tuesday, June 23, 2020 7:36 PM > To: Jeff Brasen ; devel@edk2.groups.io > Cc: Gao, Liming > Subject: RE: [PATCH v2] MdeModulePkg/DxeCorePerformanceLib: Switch to > UnicodeStrnToAsciiStrS >=20 > External email: Use caution opening links or attachments >=20 >=20 > Reviewed-by: Dandan Bi >=20 >=20 >=20 > Thanks, > Dandan > > -----Original Message----- > > From: Jeff Brasen > > Sent: Tuesday, June 23, 2020 2:20 AM > > To: devel@edk2.groups.io > > Cc: Gao, Liming ; Bi, Dandan > > ; Jeff Brasen > > Subject: [PATCH v2] MdeModulePkg/DxeCorePerformanceLib: Switch to > > UnicodeStrnToAsciiStrS > > > > UnicodeStrToAsciiStrS requires that the source string is shorter than > > the destination buffer and will ASSERT if this is not true. Switch to > > UnicodeStrnToAsciiStrS as there are cases where the source string is > > longer than the buffer allocated for the device path. > > > > Signed-off-by: Jeff Brasen > > --- > > .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > > > a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > > b.c > > > b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > > b.c > > index f500e20b32..d378c59dd9 100644 > > --- > > > a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > > b.c > > +++ > > > b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > > b.c > > @@ -837,7 +837,7 @@ GetDeviceInfoFromHandleAndUpdateLength ( > > ControllerNameStringSize =3D FPDT_MAX_PERF_RECORD_SIZE - > > (*Length) - 1; > > } > > > > - UnicodeStrToAsciiStrS(StringPtr, ComponentNameString, > > ControllerNameStringSize); > > + UnicodeStrnToAsciiStrS(StringPtr, ControllerNameStringSize - 1, > > + ComponentNameString, ControllerNameStringSize, > > + &ControllerNameStringSize); > > > > // > > // Add a space in the end of the ControllerName @@ -879,7 +879,7 > > @@ GetDeviceInfoFromHandleAndUpdateLength ( > > AsciiStringPtr =3D ComponentNameString; > > } > > > > - UnicodeStrToAsciiStrS(StringPtr, AsciiStringPtr, DevicePathStrin= gSize); > > + UnicodeStrnToAsciiStrS(StringPtr, DevicePathStringSize - 1, > > + AsciiStringPtr, DevicePathStringSize, &DevicePathStringSize); > > *Length +=3D (UINT8)DevicePathStringSize; > > return EFI_SUCCESS; > > } > > -- > > 2.17.1