mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
7793bfc31e
commit
2180250558
|
@ -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 <null>\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 <null>\n");
|
||||
}
|
||||
CpuBreakpoint ();
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue