From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4F32C1A1DF9 for ; Wed, 31 Aug 2016 09:10:35 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 31 Aug 2016 09:10:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,262,1470726000"; d="scan'208";a="3201327" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 31 Aug 2016 09:10:34 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 31 Aug 2016 09:10:34 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.39]) by fmsmsx122.amr.corp.intel.com ([10.18.125.37]) with mapi id 14.03.0248.002; Wed, 31 Aug 2016 09:10:34 -0700 From: "Carsey, Jaben" To: "Shah, Tapan" , "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Carsey, Jaben" Thread-Topic: [edk2] [patch] ShellPkg: Add the check of parameter number in "DrvCfg" command Thread-Index: AQHSA0hrJ7ykkjiwrUKMMuTwJ/HSCqBjlV0A//+ocPA= Date: Wed, 31 Aug 2016 16:10:34 +0000 Message-ID: References: <1472621209-205768-1-git-send-email-dandan.bi@intel.com> <1472621209-205768-2-git-send-email-dandan.bi@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDJlZWQzYjktOTQwMi00ZTU3LTgwMzYtYjg2YzRkOGQ2ODU0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkUwTlQ5dDhBR3VsWWhSQWw4ZFpCTUpoUkVuYSs3K3FFTVUyb1FXWUJFc3c9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [patch] ShellPkg: Add the check of parameter number in "DrvCfg" command X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 16:10:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Seems like a good check. Reviewed-by: Jaben Carsey > -----Original Message----- > From: Shah, Tapan [mailto:tapandshah@hpe.com] > Sent: Wednesday, August 31, 2016 7:24 AM > To: Bi, Dandan ; edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Carsey, Jaben > Subject: RE: [edk2] [patch] ShellPkg: Add the check of parameter number i= n > "DrvCfg" command > Importance: High >=20 > Reviewed-by: Tapan Shah >=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Dandan Bi > Sent: Wednesday, August 31, 2016 12:27 AM > To: edk2-devel@lists.01.org > Cc: Ruiyu Ni ; Jaben Carsey > Subject: [edk2] [patch] ShellPkg: Add the check of parameter number in > "DrvCfg" command >=20 > In shell spec, the usage of "Drvcfg" command is: drvcfg [-l XXX] [-c] [-f > |-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. >=20 > Cc: Ruiyu Ni > Cc: Jaben Carsey > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c > b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c > index 0d12f01..cc1c9ca 100644 > --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c > +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c > @@ -1210,10 +1210,15 @@ ShellCommandRunDrvCfg ( > ASSERT(FALSE); > } > } > } > if (ShellStatus =3D=3D SHELL_SUCCESS) { > + if (ShellCommandLineGetCount(Package) > 4) { > + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), > gShellDriver1HiiHandle, L"drvcfg"); > + ShellStatus =3D SHELL_INVALID_PARAMETER; > + goto Done; > + } > Lang =3D ShellCommandLineGetValue(Package, L"-l"); > if (Lang !=3D NULL) { > Language =3D AllocateZeroPool(StrSize(Lang)); > AsciiSPrint(Language, StrSize(Lang), "%S", Lang); > } else if (ShellCommandLineGetFlag(Package, L"-l")){ > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel