summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Universal
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2015-07-13 01:24:24 +0000
committerhwu1225 <hwu1225@Edk2>2015-07-13 01:24:24 +0000
commitc1fd37cd6bcb98143bd4a44f427735a748058ad8 (patch)
tree217efa36dc1ea2ed983c186c6439f6e08b7aa2fc /UefiCpuPkg/Universal
parent2673ffb3561be2bc31bbf0a81801c0b88c5b7fbd (diff)
downloadedk2-c1fd37cd6bcb98143bd4a44f427735a748058ad8.tar.gz
edk2-c1fd37cd6bcb98143bd4a44f427735a748058ad8.tar.bz2
edk2-c1fd37cd6bcb98143bd4a44f427735a748058ad8.zip
UefiCpuPkg S3Resume2Pei: Fix ASSERT in WriteToOsS3PerformanceData
This commit will resolve the issue brought by r17744. AsciiStrCpyS (PerfData->Token, PERF_TOKEN_SIZE, Token); The above using of AsciiStrCpyS will cause ASSERT if Token is longer than PerfData->Token. Therefore, AsciiStrnCatS is used here to resolve the issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17934 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/Universal')
-rw-r--r--UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index d9d4ecbdcb..a79fc59bdf 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -366,7 +366,7 @@ WriteToOsS3PerformanceData (
if ((AsciiStrnCmp (Token, "PEIM", PEI_PERFORMANCE_STRING_SIZE) == 0) && (Handle != NULL)) {
AsciiSPrint (PerfData->Token, PERF_TOKEN_LENGTH, "0x%11p", Handle);
} else {
- AsciiStrCpyS (PerfData->Token, PERF_TOKEN_SIZE, Token);
+ AsciiStrnCpyS (PerfData->Token, PERF_TOKEN_SIZE, Token, PERF_TOKEN_LENGTH);
}
if (StartTicker == 1) {
StartTicker = StartValue;