Hao Wu
2015-07-10 01:02:47 UTC
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 <***@intel.com>
Reviewed-by: Qiu Shumin <***@intel.com>
Reviewed-by: Jeff Fan <***@intel.com>
---
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index d9d4ecb..a79fc59 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;
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 <***@intel.com>
Reviewed-by: Qiu Shumin <***@intel.com>
Reviewed-by: Jeff Fan <***@intel.com>
---
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index d9d4ecb..a79fc59 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;
--
1.9.5.msysgit.0
1.9.5.msysgit.0