diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-01-21 07:16:26 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-01-21 07:16:26 +0000 |
commit | 9b340921eb1cbd655226302c807cf7f1a835f3de (patch) | |
tree | a15dc02c0559ed794f02d4dd3bab705d3afd1988 /ShellPkg/Library/UefiShellLib/UefiShellLib.c | |
parent | 8b23eb867c6fdd2136291ec8b505c5c593409245 (diff) | |
download | edk2-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.c | 4 |
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);
//
|