]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
check memory allocations for success.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel1CommandsLib / For.c
index 64110099d36d8f39f08db98bbd0cd77a9103c6e9..b8e4805d922e4a81068271a527ad90ad1c7cc7a5 100644 (file)
@@ -565,7 +565,9 @@ ShellCommandRunFor (
           Info->RemoveSubstAlias  = TRUE;\r
         }\r
       }\r
-      CurrentScriptFile->CurrentCommand->Data = Info;\r
+      if (CurrentScriptFile->CurrentCommand != NULL) {\r
+        CurrentScriptFile->CurrentCommand->Data = Info;\r
+      }\r
     } else {\r
       ShellPrintHiiEx(\r
         -1, \r