summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLib/UefiShellLib.c
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-21 07:16:26 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-21 07:16:26 +0000
commit9b340921eb1cbd655226302c807cf7f1a835f3de (patch)
treea15dc02c0559ed794f02d4dd3bab705d3afd1988 /ShellPkg/Library/UefiShellLib/UefiShellLib.c
parent8b23eb867c6fdd2136291ec8b505c5c593409245 (diff)
downloadedk2-UDK2010.tar.gz
edk2-UDK2010.tar.bz2
edk2-UDK2010.zip
Sync part of patch r12514 from main trunk.UDK2010
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
Diffstat (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c4
1 files changed, 4 insertions, 0 deletions
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);
//