From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.4734.1591768831869612242 for ; Tue, 09 Jun 2020 23:00:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=jzVvY23k; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: dandan.bi@intel.com) IronPort-SDR: JqMoIeGzgKCXaWtCmZRED9GKN2J4KZUimJIsOoeJap8Vnvuut/vbQXOI47icWz4wQqRfEj09w+ nXzOauEaQY1g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 23:00:31 -0700 IronPort-SDR: n3oZu5Ifr2nsv7XCtVntQIAvFzVsl7+SSOv9+c4xOK4LcxCSK3qjK/osUoSQ44VR2ugnPvILQK Sfhlm3Wdw2yg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,494,1583222400"; d="scan'208";a="274844406" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 09 Jun 2020 23:00:30 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jun 2020 23:00:30 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jun 2020 23:00:30 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jun 2020 23:00:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZgYqJph0GnC87EeB5sfLm0ITxxHjYJV7oWdSeW3euYEMY1tDLExhS+1JFU0hCvAbpr5PwaTreq2Qkw9c3fIFIusr47gQR9gXDuOrR7Sm9/P2ccp9alHEZTIDNm9FNGsvjc9SM/YFXhoGkJBv2+vAaZKWt0R5I8lKoeZRRUxeLCdYcrRSPXpcge/NyncSyWSHwV1zmrX0nxnAFkxKMtS7TmiLJ6T4Ys3X6xFEeGg6rGd2glKtyTYyqKVNrUlfc84k2/nuA13dP8y5dE46E976INn0WVzQIwpzX2FOFzNAcaNgKu4KVDdzztiYMPd04UNI7Pc0HsQyfsjvkkFnjPtNZg== 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=orIXr34JzvhQCokvHf9sSQhvqX1+23/levar8J9V5Z8=; b=ARL7EdJ2TfGYPO4DGNfLOFcc8B2GmVSi+TSMU2pQHPQNt69mL3txl9+IlSOuBOH3bbI76ZL1NFNjAm9mTUwHDeCMPpWx1xW805P8KBbOW/Pm0mQCCsd4Kr19jRUeXB69UotUOHzYraC7mcLh9e9iqoF3NBpaeorbaQ+wPqm+B5DLOsGNPuiHd1YLd7VfidLIp+T65m8HN73s5n3Ig1IZh34zN22oTyVMXgXcPlOOOuN6S/HBxV3Kwl7Y5PuvwMOTzNQ/LdyH6FFpE/+W5wYxpuEzw0sfaw3DQLR7kB9ixwNQVGlkGGhPWNC0KYihCycZNqv62hmF6uqMfzHtlrrt3A== 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=orIXr34JzvhQCokvHf9sSQhvqX1+23/levar8J9V5Z8=; b=jzVvY23kZYmIjdM2hGzklWT0rRj1snvOophgrxcnh50/Z13ecQ+1uwepWLwkwQhlzQQRbLzH+LE2PR6caz9hBYZj3ne1rlW/0PdzajJsdQ8AyyuVKiDwUKbEQeejwC8ioXx7fzT3hAtb2UM6Rsdp7x/bIwaC0tA2XzqJpTyCgI0= Received: from BN6PR11MB1393.namprd11.prod.outlook.com (2603:10b6:404:3c::12) by BN6PR11MB4084.namprd11.prod.outlook.com (2603:10b6:405:7f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.22; Wed, 10 Jun 2020 06:00:27 +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.3066.023; Wed, 10 Jun 2020 06:00:26 +0000 From: "Dandan Bi" To: "devel@edk2.groups.io" , "jbrasen@nvidia.com" CC: "Gao, Liming" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Thread-Index: AQHWOFl6kstWFgnbH0+zw2ZgJB9XEKjRZ1Mg Date: Wed, 10 Jun 2020 06:00:26 +0000 Message-ID: References: <9254b0b3c07d70dffc45aa919658ee32f2f54874.1591044879.git.jbrasen@nvidia.com> In-Reply-To: <9254b0b3c07d70dffc45aa919658ee32f2f54874.1591044879.git.jbrasen@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 653cecd4-fe33-43b9-be3c-08d80d0392a6 x-ms-traffictypediagnostic: BN6PR11MB4084: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 0430FA5CB7 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vvT+8/KjrDL4YtGktrQIN0snMOGOTMFQYEhDtXFN1dRolyldLMKZypB1f4okq1e3ZvgLV1GkkvP05a+Sj1MdnTpje+w5dd3a545pfZlin22torxUwephjPn3E0p7CK+yb6iK/pYDZGfuEqgMcHdzz8BU+/h/SWu6bmTQVQn3JHbe6p8PZ+HdKPmbOj/v3qt7Trgdi/bBjcM6XmTHF9fntwAFG8A3Dv5yNsBTtiF24esAcvmW37/L8ABUci/h7DLjHKqcBnGxxLFbz663BtYKQMk0erljVCPNaKCMixMKyeITLARQ9EeyoNa1qLZ8CW+cC7HMH6qiCUhLuPHcyEx0xyw8HMxTBNmyuzIVBgUD/3HnRZa5TNAhpfZSw0J42PWc22fQsShtFnXTEYXYJVGLWwr45vtB9LDUGirWKbaBYHKkMFzUr5ncB7fJNP5Ae3FQcFZBHsIo2zOHoJ1Fak/BKw== 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)(346002)(366004)(396003)(376002)(136003)(39860400002)(66476007)(7696005)(110136005)(53546011)(86362001)(6506007)(66446008)(64756008)(71200400001)(66556008)(2906002)(66946007)(107886003)(33656002)(5660300002)(186003)(8936002)(76116006)(966005)(83380400001)(9686003)(52536014)(8676002)(478600001)(55016002)(316002)(26005)(4326008)(145603002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: BHpvOcHivZ4nEaCzDOsgYlFWMTj6c6sBkIsejy9HVJ75Y7xdOeaNw/RHvmMY8NtGse+mIDmWg2ZWZoWue77GEj6BZsbHmEhSIHnDHr+IqpT00gn+mxl1CdfWgphe8KdlaE1NTI46/td+zOBC6mss9guRDxqZI+AK5a1QUOuamgwxJMbXC5zPdhgitDIWqRbkvLpaVjy49+wKVrwRZjcTARwYpD1ZImutv8IzK9cmJoiXFw7Fr6n7QqQeVARtYi1AWUCPaDvqEaHtiDsM5MuU/v0c5c+6gATrkNuiOozinakzZi7/Xgb6rinUGrAQo7yU56K/fG22YJKotT0z+MHtXAX8isWS51mZ+L+ik3vLeeai88YZpdF9n4cLVNnlkE4JAT4DtH/BPgHI09aTKr6y/cHD0jCgNJQpSUqWANNH2sMFBCXeJD5Ee2lWqLH0nK2qGGdEEPpsWHSbdGUZxlWvEPB8aT3TUBtD4VjUSZpiWHo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 653cecd4-fe33-43b9-be3c-08d80d0392a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2020 06:00:26.7360 (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: wsrpRJeeiGLdxKb/P9BFWS4nymtIRYIeO9/RBDSMP67U4LN3TZEpLI4I5jlNPRDVkHeuIaQK5/VFRIORtVdm1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4084 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 Thanks for the fix. Could you also help update the UnicodeStrToAsciiStrS usage at line 840? Wh= ich potentially has the similar issue. UnicodeStrToAsciiStrS(StringPtr, ComponentNameString, ControllerNameString= Size); Thanks, Dandan > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Jeff > Brasen > Sent: Tuesday, June 2, 2020 5:13 AM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Gao, Liming = ; > Jeff Brasen > Subject: [edk2-devel] [PATCH] MdeModulePkg/DxeCorePerformanceLib: > Switch to UnicodeStrnToAsciiStrS >=20 > UnicodeStrToAsciiStrS requires that the source string is shorter than th= e > destination buffer and will ASSERT if this is not true. Switch to > UnicodeStrnToAsciiStrS as there are cases where the source string is lon= ger > than the buffer allocated for the device path. >=20 > Signed-off-by: Jeff Brasen > --- > .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git > a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > b.c > b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > b.c > index f500e20b32..89ae6fb964 100644 > --- > a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > b.c > +++ > b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLi > b.c > @@ -879,7 +879,7 @@ GetDeviceInfoFromHandleAndUpdateLength ( > AsciiStringPtr =3D ComponentNameString; > } >=20 > - UnicodeStrToAsciiStrS(StringPtr, AsciiStringPtr, DevicePathString= Size); > + UnicodeStrnToAsciiStrS(StringPtr, DevicePathStringSize - 1, > + AsciiStringPtr, DevicePathStringSize, &DevicePathStringSize); > *Length +=3D (UINT8)DevicePathStringSize; > return EFI_SUCCESS; > } > -- > 2.17.1 >=20 >=20 >=20