From c5e0de8794346f0e11ae63f1e7705e784dcd5f81 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Thu, 4 Nov 2010 20:58:23 +0000 Subject: Prevent infinite recursion when ASSERT(), DEBUG(), or any other use of ReportStatusCode is performed at > TPL_NOTIFY or there is not enough memory to allocate a buffer for the ExtendedData associated with the status code being reported git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11003 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'MdeModulePkg/Library/PeiReportStatusCodeLib') diff --git a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c index 896c286834..176c7ada4d 100644 --- a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c @@ -470,6 +470,11 @@ ReportStatusCodeEx ( ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0))); 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); return EFI_OUT_OF_RESOURCES; } StatusCodeData = (EFI_STATUS_CODE_DATA *) Buffer; -- cgit v1.2.3