diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c index af788cd4c9..a3603f862f 100644 --- a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c +++ b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c @@ -28,6 +28,12 @@ #include #include +// +// Define the maximum extended data size that is supported when a status code is +// reported at TPL_HIGH_LEVEL. +// +#define MAX_EXTENDED_DATA_SIZE 0x200 + EFI_REPORT_STATUS_CODE mReportStatusCode = NULL; /** @@ -488,7 +494,7 @@ ReportStatusCodeEx ( EFI_STATUS Status; EFI_STATUS_CODE_DATA *StatusCodeData; EFI_TPL Tpl; - UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)]; + UINT64 Buffer[(MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)) + 1]; ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0))); ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0))); @@ -515,12 +521,12 @@ ReportStatusCodeEx ( // // If a buffer could not be allocated, then see if the local variable Buffer can be used // - if (ExtendedDataSize > (EFI_STATUS_CODE_DATA_MAX_SIZE - sizeof (EFI_STATUS_CODE_DATA))) { + if (ExtendedDataSize > (MAX_EXTENDED_DATA_SIZE - sizeof (EFI_STATUS_CODE_DATA))) { // // The local variable Buffer not large enough to hold the extended data associated // with the status code being reported. // - ASSERT (FALSE); + DEBUG ((EFI_D_ERROR, "Status code extended data is too large to be reported!\n")); return EFI_OUT_OF_RESOURCES; } StatusCodeData = (EFI_STATUS_CODE_DATA *)Buffer; diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c index 6c593429d9..c49dacaeb1 100644 --- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c +++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c @@ -394,6 +394,7 @@ ReportStatusCodeEx ( ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0))); if (ExtendedDataSize > EFI_STATUS_CODE_DATA_MAX_SIZE) { + DEBUG ((EFI_D_ERROR, "Status code extended data is too large to be reported!\n")); return EFI_OUT_OF_RESOURCES; }