ShellPkg: Add checking for memory allocation and pointer returns from functions.

signed-off-by: jcarsey
reviewed-by: lgrosenb

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12542 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-10-17 17:49:21 +00:00
parent 532691c8ba
commit c8c2259156
4 changed files with 16 additions and 9 deletions

View File

@ -1040,7 +1040,7 @@ UpdateStdInStdOutStdErr(
TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
}
Size = 0;
if (((EFI_FILE_PROTOCOL*)TempHandle)->Read(TempHandle, &Size, NULL) != EFI_BUFFER_TOO_SMALL) {
if (TempHandle != NULL || ((EFI_FILE_PROTOCOL*)TempHandle)->Read(TempHandle, &Size, NULL) != EFI_BUFFER_TOO_SMALL) {
Status = EFI_INVALID_PARAMETER;
} else {
ShellParameters->StdIn = TempHandle;