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>
}\r
} \r
if (ShellStatus == SHELL_SUCCESS) {\r
+ if (ShellCommandLineGetCount(Package) > 4) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvcfg");\r
+ ShellStatus = SHELL_INVALID_PARAMETER;\r
+ goto Done;\r
+ }\r
Lang = ShellCommandLineGetValue(Package, L"-l");\r
if (Lang != NULL) {\r
Language = AllocateZeroPool(StrSize(Lang));\r