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
This commit is contained in:
@ -169,7 +169,7 @@ HFileImageRead (
|
||||
// you should set the status string
|
||||
//
|
||||
Status = ReadFileIntoBuffer (FileName, (VOID**)&Buffer, &HFileImage.Size, &HFileImage.ReadOnly);
|
||||
if (EFI_ERROR(Status)) {
|
||||
if (EFI_ERROR(Status) || Buffer == NULL) {
|
||||
UnicodeBuffer = CatSPrint(NULL, L"Read error on file &s: %r", FileName, Status);
|
||||
if (UnicodeBuffer == NULL) {
|
||||
SHELL_FREE_NON_NULL(Buffer);
|
||||
|
Reference in New Issue
Block a user