From nobody Thu Mar 28 12:41:17 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+61566+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+61566+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; t=1592850029; cv=none; d=zohomail.com; s=zohoarc; b=SrTEZ0uKYjklt7v0pkGgCMjysZA0yRAuh0XWn1SkOOCKVztuxYmE7IBB1/bvNYhmAhUNNNta85BRf37e+35zhx9Npye7rlt1n4F9/IuEVUS9AW/AyQb6hFLH+0v/DDvGWUDEn5SbkmoqIdgXzRjlODqLqN8j1fA7P97sCkU1srA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592850029; h=Content-Type:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=BUYzK0gtqX8ZsXYYkQvQ6hO9yPuJuzU5tdzMTweNo7s=; b=CSrtLNiMKKTRZyrMsR3AhMZsBchCNoj+UgG/NtQparY8aKkotg60ohxBRxnR2fppNu7fk4Zt4mq6fKp+h7zjnGFp9ILXEPkcM1Omdoh4UNZ7RQrd3PbTsa7JG/xy0TYALZP3BvQhMB2/MeVpHh46HTf5pgbnTA7NncUqn8kQnn4= 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+61566+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 1592850029644112.653634376632; Mon, 22 Jun 2020 11:20:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rldiYY1788612xl1wJALDGnV; Mon, 22 Jun 2020 11:20:29 -0700 X-Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by mx.groups.io with SMTP id smtpd.web12.868.1592850028686194227 for ; Mon, 22 Jun 2020 11:20:28 -0700 X-Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 22 Jun 2020 11:20:15 -0700 X-Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 22 Jun 2020 11:20:28 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 22 Jun 2020 11:20:28 -0700 X-Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 22 Jun 2020 18:20:26 +0000 X-Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 22 Jun 2020 18:20:26 +0000 X-Received: from jbrasen-ux.nvidia.com (Not Verified[10.2.52.119]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 22 Jun 2020 11:20:25 -0700 From: "Jeff Brasen" To: CC: , , Jeff Brasen Subject: [edk2-devel] [PATCH v2] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Date: Mon, 22 Jun 2020 12:20:16 -0600 Message-ID: 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: jAS4AzVakVCZZMPBVnPIRONKx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592850029; bh=4Ss99ccOHbgOljDscAsb/4BMEt0zjkd4I45H1ufy4ss=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Mjh+Lvv2UW+R99nWPR/xGJPFze/92RiffFyfOBPoYqF6a6PDW+hco3leRBHR2cTmz6P hg7AEzWTAyFRQILPDEl9k0Z3JMnYisgnokQ3RujlbNZZ/znagvBUCMEVl1/3MS+Wtr3t4 lCFqXTmX8DuRmjMXg+qp2Hjt7Lqo+1o+Iqk= 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 Reviewed-by: Dandan Bi --- .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index f500e20b32..d378c59dd9 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -837,7 +837,7 @@ GetDeviceInfoFromHandleAndUpdateLength ( ControllerNameStringSize =3D FPDT_MAX_PERF_RECORD_SIZE - (*Length) -= 1; } =20 - UnicodeStrToAsciiStrS(StringPtr, ComponentNameString, ControllerNameSt= ringSize); + UnicodeStrnToAsciiStrS(StringPtr, ControllerNameStringSize - 1, Compon= entNameString, ControllerNameStringSize, &ControllerNameStringSize); =20 // // Add a space in the end of the ControllerName @@ -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 (#61566): https://edk2.groups.io/g/devel/message/61566 Mute This Topic: https://groups.io/mt/75044750/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-