From: "Jeff Brasen" <jbrasen@nvidia.com>
To: <devel@edk2.groups.io>
Cc: <dandan.bi@intel.com>, <liming.gao@intel.com>,
Jeff Brasen <jbrasen@nvidia.com>
Subject: [PATCH] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS
Date: Mon, 1 Jun 2020 15:12:37 -0600 [thread overview]
Message-ID: <9254b0b3c07d70dffc45aa919658ee32f2f54874.1591044879.git.jbrasen@nvidia.com> (raw)
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 <jbrasen@nvidia.com>
---
.../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.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 = ComponentNameString;
}
- UnicodeStrToAsciiStrS(StringPtr, AsciiStringPtr, DevicePathStringSize);
+ UnicodeStrnToAsciiStrS(StringPtr, DevicePathStringSize - 1, AsciiStringPtr, DevicePathStringSize, &DevicePathStringSize);
*Length += (UINT8)DevicePathStringSize;
return EFI_SUCCESS;
}
--
2.17.1
next reply other threads:[~2020-06-01 21:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 21:12 Jeff Brasen [this message]
2020-06-10 6:00 ` [edk2-devel] [PATCH] MdeModulePkg/DxeCorePerformanceLib: Switch to UnicodeStrnToAsciiStrS Dandan Bi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9254b0b3c07d70dffc45aa919658ee32f2f54874.1591044879.git.jbrasen@nvidia.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox