diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-03 21:54:37 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-06-03 21:54:37 +0000 |
commit | 21802505584d4251d97625d9ab382a3276b2d22d (patch) | |
tree | ed5e2121b91978323b05bb852c3dfb44284f3963 /EdkNt32Pkg/Sec | |
parent | 7793bfc31edac639c97eb1fcf55da908eb9d6aff (diff) | |
download | edk2-platforms-21802505584d4251d97625d9ab382a3276b2d22d.tar.xz |
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
Diffstat (limited to 'EdkNt32Pkg/Sec')
-rw-r--r-- | EdkNt32Pkg/Sec/SecMain.c | 20 |
1 files changed, 13 insertions, 7 deletions
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 <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;
|