From nobody Sun Apr 28 16:00:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60550+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60550+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; t=1591045970; cv=none; d=zohomail.com; s=zohoarc; b=PocMBCiRN3s4NC4IDcC36uY0su+A6AQNMh1MZQlRIqhtcGdHkcioH2GpNnzchd/Fn171/Kt7VufwSn1zVADUK8jwdyJm3dIt2BCRa3pOIkmSEGc4pSO2mw3GZmwi6uE+2d4R5Y1xhBfNeDf0jwLVZZ7IilSHRN3ooDD8OcwdCvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591045970; h=Content-Type:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=9PmoBsQYYUZ6qK9D3N0LCNnJcjkOsx8FkLPwQlD9acs=; b=XD/lWJ2nFFzQukiNNsJwIijrAOWfApOR57ERI83SQS+koTM0VecEPWpFP1KiTEXXto52+zs5hkct1ZNEaDOmRaguIDcTBgqW5WS5TRFVBaI8np89CAT4K0ZkNlc2gDUpoVpSmxB8u9R8X27kky0eUTGzFStCk0c3aNjlsmM6Kak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60550+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591045970381119.13714480397346; Mon, 1 Jun 2020 14:12:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IlclYY1788612x5ishqANrZr; Mon, 01 Jun 2020 14:12:50 -0700 X-Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by mx.groups.io with SMTP id smtpd.web12.47979.1591045969366558955 for ; Mon, 01 Jun 2020 14:12:49 -0700 X-Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 01 Jun 2020 14:11:22 -0700 X-Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 01 Jun 2020 14:12:49 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 01 Jun 2020 14:12:49 -0700 X-Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 1 Jun 2020 21:12:46 +0000 X-Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 1 Jun 2020 21:12:45 +0000 X-Received: from jbrasen-ux.nvidia.com (Not Verified[10.2.88.96]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 01 Jun 2020 14:12:45 -0700 From: "Jeff Brasen" To: CC: , , Jeff Brasen Subject: [edk2-devel] [PATCH] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Date: Mon, 1 Jun 2020 15:12:37 -0600 Message-ID: <9254b0b3c07d70dffc45aa919658ee32f2f54874.1591044879.git.jbrasen@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jbrasen@nvidia.com X-Gm-Message-State: YMvHvsN4xyiXDf9Q7BQ8YFyex1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591045970; bh=t25Uu+UFwz138JJezUkIutaJzQsPnUZrAESaB8kKBbc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=M42xT696lEX7vOzTGxg4SqKRGK5S34QBlZpQqPpKPH8ONm5V3wjL6O6xQvf0G2YnGOI X3ztMHQwLZ/mAb9+FeMd4c/QXGYRHto2CMmy3/8cAC+/aHybDlPSt6x649PEuVAdn87FA szAXv8L0cWowI3KrXI5zURzdbRJVCmcj2ks= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index f500e20b32..89ae6fb964 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -879,7 +879,7 @@ GetDeviceInfoFromHandleAndUpdateLength ( AsciiStringPtr =3D ComponentNameString; } =20 - UnicodeStrToAsciiStrS(StringPtr, AsciiStringPtr, DevicePathStringSiz= e); + UnicodeStrnToAsciiStrS(StringPtr, DevicePathStringSize - 1, AsciiStr= ingPtr, DevicePathStringSize, &DevicePathStringSize); *Length +=3D (UINT8)DevicePathStringSize; return EFI_SUCCESS; } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60550): https://edk2.groups.io/g/devel/message/60550 Mute This Topic: https://groups.io/mt/74615004/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-