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:
@@ -438,6 +438,11 @@ ShellCommandRunFor (
|
|||||||
gEfiShellParametersProtocol->Argv[2]) == 0) {
|
gEfiShellParametersProtocol->Argv[2]) == 0) {
|
||||||
for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
|
for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
|
||||||
ASSERT((ArgSet == NULL && ArgSize == 0) || (ArgSet != NULL));
|
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) {
|
if (ArgSet == NULL) {
|
||||||
// ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
|
// ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user