summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLevel1CommandsLib
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-07 17:12:12 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-07 17:12:12 +0000
commitd8f8021cbe89187c443e6a9ee89eb3edc8248ab4 (patch)
treef9839a4926ff36aea907d79f14d03c8b5004a320 /ShellPkg/Library/UefiShellLevel1CommandsLib
parentb97a8d3586266504c6140ffd111a6d80ce471225 (diff)
downloadedk2-d8f8021cbe89187c443e6a9ee89eb3edc8248ab4.tar.gz
edk2-d8f8021cbe89187c443e6a9ee89eb3edc8248ab4.tar.bz2
edk2-d8f8021cbe89187c443e6a9ee89eb3edc8248ab4.zip
ShellParametersProtocol - remove parsing from within quoted parameters.
Pci - Add missing enumeration in switch statement. For - Verify parameter before dereferencing. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11511 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/For.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
index b8e4805d92..bc26ed31bc 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
@@ -589,11 +589,16 @@ ShellCommandRunFor (
ASSERT(ArgSet == NULL);
}
- Info = (SHELL_FOR_INFO*)CurrentScriptFile->CurrentCommand->Data;
- if (CurrentScriptFile->CurrentCommand->Reset) {
- Info->CurrentValue = (CHAR16*)Info->Set;
- FirstPass = TRUE;
- CurrentScriptFile->CurrentCommand->Reset = FALSE;
+ if (CurrentScriptFile != NULL && CurrentScriptFile->CurrentCommand != NULL) {
+ Info = (SHELL_FOR_INFO*)CurrentScriptFile->CurrentCommand->Data;
+ if (CurrentScriptFile->CurrentCommand->Reset) {
+ Info->CurrentValue = (CHAR16*)Info->Set;
+ FirstPass = TRUE;
+ CurrentScriptFile->CurrentCommand->Reset = FALSE;
+ }
+ } else {
+ ShellStatus = SHELL_UNSUPPORTED;
+ Info = NULL;
}
if (ShellStatus == SHELL_SUCCESS) {
ASSERT(Info != NULL);