From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.4404.1592962588641427233 for ; Tue, 23 Jun 2020 18:36:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Dby++XY8; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: dandan.bi@intel.com) IronPort-SDR: oGL6wVR2bGEA4GdZFSv44KSU016JYW26mA5OrMvUEuAuIzI0nZgvtDtza8VkSoKXA+uEbZbXtt aD/qLJeDvSSw== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="144322283" X-IronPort-AV: E=Sophos;i="5.75,273,1589266800"; d="scan'208";a="144322283" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2020 18:36:27 -0700 IronPort-SDR: i+YMYLeAhxER0pZi06LRkrY+lOUs1Zx+zcB+OW5PXtOq+ou9SGCDNQckD+/4xE7g5kR6ODsKe+ s4q+tz8j/dug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,273,1589266800"; d="scan'208";a="319315419" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 23 Jun 2020 18:36:27 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 23 Jun 2020 18:36:26 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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; Tue, 23 Jun 2020 18:36:26 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 23 Jun 2020 18:36:26 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.105) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 23 Jun 2020 18:36:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fQqi5Kf5JR/2eNqRPBVBsL8hDwSvOgGIMxs9IeFhNS9a4IneNdAtxvydDB6qKDcfOx6OcwNaqSbX0HPxqNwpuJxoDLg0PvCixln+Nsyu0ZKMSMSUflRSZnpYv7J6V2LCo5tcUpMGs8eIoQRM+CVUcgU1JRkAD9LiNug3KDzfUBgWQqhH++3TaXMZvRLLCORJ9LV/z4ku3N9QVA4w25sSw10XnWxkaiXg86bhEyUSAmIQVfzXIxJqkYza2FPNiThmuIitfMEcjwnhpJIAv4CtpkRWCXWdLI9x1LV83Y30kal7dOv6bG/wGCH9cf7i5BAevV4dEyp+rn+SZUJqLFf/Dw== 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=/GjWnakHWDB45sEkjaQ+zTPCVcJUkLT83OhTch965VE=; b=ZIOhMTSj6wI6eYiSyRaNZJdFJ3dlvzZnHpVevNH5CtClI8vXlEOs0d8FkCbvmxLt0JK2sij+HpQnVWqzUPCXgyPdLvFK/1d/g6e6vvOe1ylNV8gGww9+I1V9cFAMvU/5IwdFAsVx1h2LEG1WwsreT+YWIgCsOjsaDkrBwuKp8on3XT6oyKOF0xfaeREsJjCCvM3QMeAYzP6t/IuwypexJpASkdPnz7SB6n8a5gCrmhkuXTvVagZzdDhsJOQ55hgMpGdak+7Rl8cU4P+8PlFuZxMdJzpPiXBS0c/prmHclv977k4Mc3GPLERCeu0xhlwWpMZUXafsVDoPdLs5soKcaA== 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=/GjWnakHWDB45sEkjaQ+zTPCVcJUkLT83OhTch965VE=; b=Dby++XY8cVg5mMmUanqDWmQ0cztIR5kvhXt5jMtIv1kOnF30y9ypzeulJBxMjWIiEhv93BhKxFsn7esUf39GqtbTuzr0XS908RY7J2dm+qbj3iuMxSD+51nR5vK08rmIjGTFaH/HmZ9hcmgnu9AySjnFDmM/fRvu+xfqi8hsry4= Received: from BN6PR11MB1393.namprd11.prod.outlook.com (2603:10b6:404:3c::12) by BN6PR11MB1249.namprd11.prod.outlook.com (2603:10b6:404:3e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Wed, 24 Jun 2020 01:36:25 +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.3109.027; Wed, 24 Jun 2020 01:36:25 +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/Vtg Date: Wed, 24 Jun 2020 01:36:24 +0000 Message-ID: References: In-Reply-To: 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.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e53d8ef5-5250-40de-0af6-08d817df01f0 x-ms-traffictypediagnostic: BN6PR11MB1249: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0444EB1997 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Z6dgQJHd+L7GGcT+x+jVRjbT9gzxMXNW2zsUFpTA6L1AIhZ2TxETDXToytQ7zLBzBgAlOW02ih/41Mj4k38Cbo3VCffQ2yw3rzasVkY4oug5MsRpRl21gsWChfjCAmkhccUO8+lToRSMH9HthZnCX5q4nzEox1S5LIdOo0MW/B4XEEEymszGTRrmd1UlybBb0Ae4O+GI4Gk22rPPDwSjjiZl2fAgzFF+rCavT7EwlJIIH70wHPgT6PnxLrMGVMV89LzhUJ36vHGaxw4RRSrheLD3Vg8LHu1Dl5Ovua43J7qB6Hg1zMoTrDJNO5UNvep3jR+YPQRZ0H1W8D41om7+a9hsIWqOkauhPep1RL0lZquL52xqn5Ul1Yqc1Q5m7UGL 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)(346002)(366004)(396003)(39860400002)(83380400001)(55016002)(7696005)(186003)(66946007)(26005)(107886003)(4326008)(8676002)(8936002)(6506007)(53546011)(33656002)(9686003)(86362001)(5660300002)(76116006)(52536014)(64756008)(2906002)(478600001)(316002)(66476007)(66556008)(66446008)(110136005)(71200400001)(145603002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: jTwgMWahPPpXQPbevCMlISXDo72s2iHOzKlwBddt/dYWVW5gW0wjk1xXPkE5Cx3obt1HuqYUBVCyb7haE/KnIpNBYIOKzyvb0ULXS1ZfwC5Pha8KYPNJauXAVXu1Wkg4uapRsV70iD6ytrngsryb8ILC4b+M0s9j27q2pc5HD5NfaNZ4NuMmuCRXhASELy6niKY5nNpUmgSIKFcIakts8tX7fP94gPsejEhI0+rMItaYcr68nMqdoO+XvTYHvFLHArmNMSuWWLhYdrqVFabo7kNofX163D+MdibAwX1yI9uNvGbnCYFYx6fAJgttPQixksiCbmoDnuz3TbubeHExtyFrYQc+OqbCEt4pB6zK84bNE5uWW1xz9sA8b1vxPpnFXlVd2Qs4ZLOv9m6hjtFCdDDDFBvxkFVvnSMCqR8EsiMorhc7c6fqZMAIrgkUWvjCkfbA7vfS3yyVw4zx55ntAkDrVElvXx+AJhA7tZKI6OPtohFbgvuWA3a7p/A2DASy MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e53d8ef5-5250-40de-0af6-08d817df01f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2020 01:36:24.8070 (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: MzRo3H95UinqilfrKFzRHi7vddWd78bfy7qFA5hKWt6MxYtBRLj6zkA0HpLivhfuF7Z2NdgrhzNkYdCl3pIkng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1249 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 Reviewed-by: Dandan Bi 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 >=20 > 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 long= er > than the buffer allocated for the device path. >=20 > Signed-off-by: Jeff Brasen > --- > .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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; > } >=20 > - UnicodeStrToAsciiStrS(StringPtr, ComponentNameString, > ControllerNameStringSize); > + UnicodeStrnToAsciiStrS(StringPtr, ControllerNameStringSize - 1, > + ComponentNameString, ControllerNameStringSize, > + &ControllerNameStringSize); >=20 > // > // Add a space in the end of the ControllerName @@ -879,7 +879,7 @@ > GetDeviceInfoFromHandleAndUpdateLength ( > AsciiStringPtr =3D ComponentNameString; > } >=20 > - UnicodeStrToAsciiStrS(StringPtr, AsciiStringPtr, DevicePathStringS= ize); > + UnicodeStrnToAsciiStrS(StringPtr, DevicePathStringSize - 1, > + AsciiStringPtr, DevicePathStringSize, &DevicePathStringSize); > *Length +=3D (UINT8)DevicePathStringSize; > return EFI_SUCCESS; > } > -- > 2.17.1