From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 050102242383D for ; Wed, 28 Feb 2018 22:28:22 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 22:34:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="34573252" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.13]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2018 22:34:29 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Liming Gao Date: Thu, 1 Mar 2018 14:34:28 +0800 Message-Id: <20180301063428.164164-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 Subject: [PATCH] MdeModulePkg/DebugLibReportStatusCode: Fix hang if format is too long X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:28:23 -0000 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 Cc: Liming Gao --- MdeModulePkg/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.16.1.windows.1