Discussion:
[edk2] [PATCH 03/13] MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode: Use safe string functions to refine code.
Qiu Shumin
2015-06-25 07:46:46 UTC
Permalink
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
index 68c1a55..f1d9827 100644
--- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
+++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
@@ -115,7 +115,7 @@ DebugPrint (
//
// Copy the Format string into the record
//
- AsciiStrCpy (FormatString, Format);
+ AsciiStrCpyS (FormatString, sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)), Format);

//
// The first 12 * sizeof (UINT64) bytes following EFI_DEBUG_INFO are for variable arguments
--
1.9.5.msysgit.1
Gao, Liming
2015-06-29 08:39:46 UTC
Permalink
Reviewed-by: Liming Gao <***@intel.com>

-----Original Message-----
From: Qiu, Shumin
Sent: Thursday, June 25, 2015 3:47 PM
To: edk2-***@lists.sourceforge.net
Cc: Zeng, Star; Fan, Jeff; Gao, Liming; Ni, Ruiyu; Tian, Feng
Subject: [PATCH 03/13] MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode: Use safe string functions to refine code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
index 68c1a55..f1d9827 100644
--- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
+++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
@@ -115,7 +115,7 @@ DebugPrint (
//
// Copy the Format string into the record
//
- AsciiStrCpy (FormatString, Format);
+ AsciiStrCpyS (FormatString, sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)), Format);

//
// The first 12 * sizeof (UINT64) bytes following EFI_DEBUG_INFO are for variable arguments
--
1.9.5.msysgit.1
Loading...