summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-14 19:21:13 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-14 19:21:13 +0000
commit532691c8ba90e5022174503ab0781322c6f79cab (patch)
tree7c598451898c979b99cdfa0ec1573d509d5ee1ff /ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
parentde2a15eebbf467c335f3e28ff0ba0ca6dd0ddcf2 (diff)
downloadedk2-platforms-532691c8ba90e5022174503ab0781322c6f79cab.tar.xz
ShellPkg: Add checking for memory allocation and pointer returns from functions.
signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12540 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c')
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
index a9dd6ccdab..6f67f49aea 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
@@ -145,6 +145,10 @@ TestNodeForMove (
//
CommandName = NULL;
CommandName = StrnCatGrow(&CommandName, NULL, CommandNode->Cl, 0);
+ if (CommandName == NULL) {
+ return (FALSE);
+ }
+
CommandNameWalker = CommandName;
while(CommandNameWalker[0] == L' ') {
CommandNameWalker++;