From a7119c81528072b13e9664ce51f70b8f91f4d9e2 Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Thu, 1 Mar 2018 14:33:43 +0800 Subject: [PATCH] MdeModulePkg/DebugLibReportStatusCode: Fix hang if format is too long The previous commit 137ed15511e2045a7333e33ae7f1e873ce1961dd * MdeModulePkg/DebugLib: Print partial when format string is too long copies partial format string to DEBUG_INFO buffer but when parsing the format modifier, the original format string is still used. The patch fixes this issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Reviewed-by: Liming Gao --- .../Library/PeiDxeDebugLibReportStatusCode/DebugLib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c index 16a1d206fb..96c9b30987 100644 --- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c +++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c @@ -126,6 +126,11 @@ DebugPrint ( // Here we will process the variable arguments and pack them in this area. // VA_START (VaListMarker, Format); + + // + // Use the actual format string. + // + Format = FormatString; for (; *Format != '\0'; Format++) { // // Only format with prefix % is processed. -- 2.39.2