ShellPkg: Fix 'for' command fail with multiple fields.

When multiple fields are found in 'for' command return invalid parameters error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18416 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Qiu Shumin 2015-09-09 04:57:05 +00:00 committed by shenshushi
parent 50e7d3d90d
commit 8337590c42
1 changed files with 5 additions and 0 deletions

View File

@ -438,6 +438,11 @@ ShellCommandRunFor (
gEfiShellParametersProtocol->Argv[2]) == 0) {
for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
ASSERT((ArgSet == NULL && ArgSize == 0) || (ArgSet != NULL));
if (StrStr (gEfiShellParametersProtocol->Argv[LoopVar], L")") != NULL &&
(LoopVar + 1) < gEfiShellParametersProtocol->Argc
) {
return (SHELL_INVALID_PARAMETER);
}
if (ArgSet == NULL) {
// ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
} else {