From: mdkinney Date: Sat, 3 Jun 2006 21:54:37 +0000 (+0000) Subject: Add check for a NULL Data parameter in SecPeiReportStatusCode(). The Report Status... X-Git-Tag: edk2-stable201903~25326 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=21802505584d4251d97625d9ab382a3276b2d22d;hp=7793bfc31edac639c97eb1fcf55da908eb9d6aff Add check for a NULL Data parameter in SecPeiReportStatusCode(). The Report Status Code Library functions will ASSERT() is Data is NULL. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@410 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkNt32Pkg/Sec/SecMain.c b/EdkNt32Pkg/Sec/SecMain.c index fbd05c5173..26f10c4e05 100644 --- a/EdkNt32Pkg/Sec/SecMain.c +++ b/EdkNt32Pkg/Sec/SecMain.c @@ -473,24 +473,30 @@ Returns: // The first 12 * UINT64 bytes of the string are really an // arguement stack to support varargs on the Format string. // - DebugInfo = (EFI_DEBUG_INFO *) (Data + 1); - Marker = (VA_LIST) (DebugInfo + 1); - Format = (CHAR8 *) (((UINT64 *) Marker) + 12); + if (Data != NULL) { + DebugInfo = (EFI_DEBUG_INFO *) (Data + 1); + Marker = (VA_LIST) (DebugInfo + 1); + Format = (CHAR8 *) (((UINT64 *) Marker) + 12); - AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker); - printf (PrintBuffer); + AsciiVSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker); + printf (PrintBuffer); + } else { + printf ("DEBUG \n"); + } } if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) && ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) ) { - if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) { + if (Data != NULL && ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) { // // Support ASSERT () macro // printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description); - CpuBreakpoint (); + } else { + printf ("ASSERT \n"); } + CpuBreakpoint (); } return EFI_SUCCESS;