From 9b340921eb1cbd655226302c807cf7f1a835f3de Mon Sep 17 00:00:00 2001 From: vanjeff Date: Sat, 21 Jan 2012 07:16:26 +0000 Subject: Sync part of patch r12514 from main trunk. Add pointer check for NULL before dereference it. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2010@12953 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLib/UefiShellLib.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c') diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index d3cc59e9be..521bb8e64b 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -1784,6 +1784,10 @@ InternalCommandLineParse ( // initialize the linked list // *CheckPackage = (LIST_ENTRY*)AllocateZeroPool(sizeof(LIST_ENTRY)); + if (*CheckPackage == NULL) { + return (EFI_OUT_OF_RESOURCES); + } + InitializeListHead(*CheckPackage); // -- cgit v1.2.3