From: Qiu Shumin Date: Thu, 21 Aug 2014 05:26:25 +0000 (+0000) Subject: Append the terminating null character at the end of the string to avoid buffer overflow. X-Git-Tag: edk2-stable201903~11133 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=acbd7f9f1738561520c3ee78d683e0164ecf5764 Append the terminating null character at the end of the string to avoid buffer overflow. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Tian Feng git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15862 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c index f5100fa9ad..7575dbfd0d 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -367,6 +367,7 @@ WriteToOsS3PerformanceData ( AsciiSPrint (PerfData->Token, PERF_TOKEN_LENGTH, "0x%11p", Handle); } else { AsciiStrnCpy (PerfData->Token, Token, PERF_TOKEN_LENGTH); + PerfData->Token[PERF_TOKEN_LENGTH] = '\0'; } if (StartTicker == 1) { StartTicker = StartValue;