]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
ShellPkg: Add checking for memory allocation and pointer returns from functions.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel1CommandsLib / If.c
index d305306124e29b3bdd3df5db54ab011d924e8842..08927319d33a041eabb9419d3cefb04f33e0401b 100644 (file)
@@ -739,6 +739,9 @@ MoveToTagSpecial (
     //\r
     CommandName   = NULL;\r
     CommandName   = StrnCatGrow(&CommandName, NULL, CommandNode->Cl, 0);\r
+    if (CommandName == NULL) {\r
+      continue;\r
+    }\r
     CommandWalker = CommandName;\r
     while (CommandWalker[0] == L' ') {\r
       CommandWalker++;\r