]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS
[mirror_edk2.git] / MdeModulePkg / Library / DxeCorePerformanceLib / DxeCorePerformanceLib.c
index f500e20b320bc7fbc0606586a71c204d992bc185..d378c59dd9648e4af439f82a569b330ad450681d 100644 (file)
@@ -837,7 +837,7 @@ GetDeviceInfoFromHandleAndUpdateLength (
       ControllerNameStringSize = FPDT_MAX_PERF_RECORD_SIZE - (*Length) - 1;\r
     }\r
 \r
-    UnicodeStrToAsciiStrS(StringPtr, ComponentNameString, ControllerNameStringSize);\r
+    UnicodeStrnToAsciiStrS(StringPtr, ControllerNameStringSize - 1, ComponentNameString, ControllerNameStringSize, &ControllerNameStringSize);\r
 \r
     //\r
     // Add a space in the end of the ControllerName\r
@@ -879,7 +879,7 @@ GetDeviceInfoFromHandleAndUpdateLength (
         AsciiStringPtr = ComponentNameString;\r
       }\r
 \r
-      UnicodeStrToAsciiStrS(StringPtr, AsciiStringPtr, DevicePathStringSize);\r
+      UnicodeStrnToAsciiStrS(StringPtr, DevicePathStringSize - 1, AsciiStringPtr, DevicePathStringSize, &DevicePathStringSize);\r
       *Length += (UINT8)DevicePathStringSize;\r
       return EFI_SUCCESS;\r
     }\r