summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiHandleParsingLib
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 20:32:17 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 20:32:17 +0000
commitecae51177e83db0d99f8b4888ae4b866c18651b6 (patch)
tree61522e5d6294adbafeb58f35e61b090358c5126d /ShellPkg/Library/UefiHandleParsingLib
parentbeab0fc5e2ea7c676968991b1ae8e1fc72aef19f (diff)
downloadedk2-platforms-ecae51177e83db0d99f8b4888ae4b866c18651b6.tar.xz
ShellPkg: Add checks for NULL pointers.
This adds lots of pointer verification with ASSERTs only used when the condition should be impossible and never for memory allocation. signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12523 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiHandleParsingLib')
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 77f7756dc7..9e51648217 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -206,8 +206,10 @@ TxtOutProtocolDumpInformation(
RetVal = AllocateZeroPool(Size);
Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_TXT_OUT_DUMP_HEADER), NULL);
- UnicodeSPrint(RetVal, Size, Temp, Dev, Dev->Mode->Attribute);
- FreePool(Temp);
+ if (Temp != NULL) {
+ UnicodeSPrint(RetVal, Size, Temp, Dev, Dev->Mode->Attribute);
+ FreePool(Temp);
+ }
//
// Dump TextOut Info
@@ -219,7 +221,7 @@ TxtOutProtocolDumpInformation(
UnicodeSPrint(
RetVal + StrLen(RetVal),
NewSize,
- Temp,
+ Temp == NULL?L"":Temp,
Index == Dev->Mode->Mode ? L'*' : L' ',
Index,
!EFI_ERROR(Status)?Col:-1,