From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.7581.1575257930697348312 for ; Sun, 01 Dec 2019 19:38:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: linson.augustine@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 19:38:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,267,1571727600"; d="scan'208";a="241778709" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 01 Dec 2019 19:38:49 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 1 Dec 2019 19:38:49 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 1 Dec 2019 19:38:49 -0800 Received: from bgsmsx106.gar.corp.intel.com (10.223.43.196) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 1 Dec 2019 19:38:48 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.172]) by BGSMSX106.gar.corp.intel.com ([169.254.1.134]) with mapi id 14.03.0439.000; Mon, 2 Dec 2019 09:08:46 +0530 From: "Augustine, Linson" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH] ShellPkg/ShellProtocol: Return error code while fail parsing cmd-line Thread-Topic: [PATCH] ShellPkg/ShellProtocol: Return error code while fail parsing cmd-line Thread-Index: AQHVqKr7zfKGcHzlKEiHi3wDIEsueKemKttA Date: Mon, 2 Dec 2019 03:38:46 +0000 Message-ID: <983FD2DACE51124F8F76CF59EAD014961002FC2A@BGSMSX101.gar.corp.intel.com> References: <20191202005348.22208-1-zhichao.gao@intel.com> In-Reply-To: <20191202005348.22208-1-zhichao.gao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzQ3MTkwOTUtZjgzMi00ZDdiLTkyYmMtMDAzYjlhNDgxZmU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZGNRMDNEZXF0UWJYUGVmclwveUJyZDJxWGdoT0w5YU45VU11U2Z2NkkzQmNlY2RocjJEZHJrYU02bE0rNWdpc2cifQ== dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.223.10.10] MIME-Version: 1.0 Return-Path: linson.augustine@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed by Linson Augustine Regards, Linson. -----Original Message----- From: Gao, Zhichao =20 Sent: Monday, December 2, 2019 6:24 AM To: devel@edk2.groups.io Cc: Ni, Ray ; Augustine, Linson Subject: [PATCH] ShellPkg/ShellProtocol: Return error code while fail parsi= ng cmd-line REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2395 Errors happened in the arguments parsing is not a critical error. And it would miss the error status code in the release version of shell. So replace the ASSERT with returning error status code while fail parsing c= ommand-line in UpdateArgcArgv. Cc: Ray Ni Cc: Linson Augustine Signed-off-by: Zhichao Gao --- ShellPkg/Application/Shell/ShellProtocol.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Applicat= ion/Shell/ShellProtocol.c index 5e529b6568..f0362a42d8 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -1497,7 +1497,10 @@ InternalShellExecuteDevicePath( ShellParamsProtocol.StdOut =3D ShellInfoObject.NewShellParametersProt= ocol->StdOut; ShellParamsProtocol.StdErr =3D ShellInfoObject.NewShellParametersProt= ocol->StdErr; Status =3D UpdateArgcArgv(&ShellParamsProtocol, NewCmdLine, Efi_Applic= ation, NULL, NULL); - ASSERT_EFI_ERROR(Status); + if (EFI_ERROR (Status)) { + goto UnloadImage; + } + // // Replace Argv[0] with the full path of the binary we're executing: // If the command line was "foo", the binary might be called "foo.efi"= . -- 2.21.0.windows.1