Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a...@intel.com> Reviewed-by: Jeff Fan <jeff....@intel.com> --- .../Library/PeiDxeDebugLibReportStatusCode/DebugLib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c index 68c1a55..2d39b4a 100644 --- a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c +++ b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c @@ -56,6 +56,7 @@ DebugPrint ( UINT64 Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)) + 1]; EFI_DEBUG_INFO *DebugInfo; UINTN TotalSize; + UINTN DestBufferSize; VA_LIST VaListMarker; BASE_LIST BaseListMarker; CHAR8 *FormatString; @@ -115,7 +116,8 @@ DebugPrint ( // // Copy the Format string into the record // - AsciiStrCpy (FormatString, Format); + DestBufferSize = sizeof (Buffer) - 4 - sizeof (EFI_DEBUG_INFO) - 12 * sizeof (UINT64); + AsciiStrCpyS (FormatString, DestBufferSize / sizeof (CHAR8), Format); // // The first 12 * sizeof (UINT64) bytes following EFI_DEBUG_INFO are for variable arguments -- 1.9.5.msysgit.0 ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel