mirror of https://github.com/acidanthera/audk.git
ShellPkg: Add the check of parameter number in "DrvCfg" command
In shell spec, the usage of "Drvcfg" command is: drvcfg [-l XXX] [-c] [-f <Type>|-v|-s] [DriverHandle [DeviceHandle [ChildHandle]]] [-i filename] [-o filename]. The parameter number(doesn't include the flags) cannot exceed 4, now we add this point to check whether using the command correctly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
This commit is contained in:
parent
d653d8062e
commit
c6fc823413
|
@ -1212,6 +1212,11 @@ ShellCommandRunDrvCfg (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ShellStatus == SHELL_SUCCESS) {
|
if (ShellStatus == SHELL_SUCCESS) {
|
||||||
|
if (ShellCommandLineGetCount(Package) > 4) {
|
||||||
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvcfg");
|
||||||
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
Lang = ShellCommandLineGetValue(Package, L"-l");
|
Lang = ShellCommandLineGetValue(Package, L"-l");
|
||||||
if (Lang != NULL) {
|
if (Lang != NULL) {
|
||||||
Language = AllocateZeroPool(StrSize(Lang));
|
Language = AllocateZeroPool(StrSize(Lang));
|
||||||
|
|
Loading…
Reference in New Issue