mirror of https://github.com/acidanthera/audk.git
IntelFrameworkModulePkg PeiDxeDebugLib: Use safe string functions
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17734 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ed6d22e0f2
commit
d5cbc27b00
|
@ -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,13 @@ DebugPrint (
|
|||
//
|
||||
// Copy the Format string into the record
|
||||
//
|
||||
AsciiStrCpy (FormatString, Format);
|
||||
// According to the content structure of Buffer shown above, the size of
|
||||
// the FormatString buffer is the size of Buffer minus the Padding
|
||||
// (4 bytes), minus the size of EFI_DEBUG_INFO, minus the size of
|
||||
// variable arguments (12 * sizeof (UINT64)).
|
||||
//
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue