MdeModulePkg/DebugLibReportStatusCode: Fix hang if format is too long

The previous commit 137ed15511
* 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 <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Ruiyu Ni 2018-03-01 14:33:43 +08:00
parent 79f84eb676
commit a7119c8152
1 changed files with 5 additions and 0 deletions

View File

@ -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.