From nobody Fri Apr 26 21:36:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+51512+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51512+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1575248134; cv=none; d=zohomail.com; s=zohoarc; b=K8tH3r1dEJqa8aJ6gWbzXif5JodSRy+2EPHmanQ9AryHUD+8w9ThIXF/Q9D0wIzqiW/d1ekLskObj8EJTUHyk62YjRhn+C5clnBiuWj9+WfL3dcrYTpQJG4xgvwg9b/77Lt0zXWGRWfxUTF8BNatsywBlhPOiIecsCO2o6n8PQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575248134; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=VpZkAlYSLdhCsVn5LXR4ZR/NryzMHDBLtUS158w62s8=; b=Qg1pQtPeEJ5kVHXPndQ/kWwKvbCNWljv+X/45+5ZADYyXe4KyOG1b9Id4PqjDnFOliadYetYr/zvl02hWgbVOmxrGf/ULrQsPWabRMLn841zJwy3v5WAKDmq7fcHcsVbZNVmcgsDMN3KywaImkQmpO/3x7Uytjjxf0UnNvke950= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51512+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1575248134015468.2434304269743; Sun, 1 Dec 2019 16:55:34 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id leVxYY1788612xMxOXBtmXve; Sun, 01 Dec 2019 16:55:33 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.5696.1575248034855993314 for ; Sun, 01 Dec 2019 16:53:55 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 16:53:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,267,1571727600"; d="scan'208";a="241740838" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga002.fm.intel.com with ESMTP; 01 Dec 2019 16:53:53 -0800 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Ray Ni , Linson Augustine Subject: [edk2-devel] [PATCH] ShellPkg/ShellProtocol: Return error code while fail parsing cmd-line Date: Mon, 2 Dec 2019 08:53:48 +0800 Message-Id: <20191202005348.22208-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: peh3SY4Fwqpwk7ujqrLwflaGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1575248133; bh=ajs89KZTF2MpxYAqO1MSIu67y0VIjlhIPHNvat9CweM=; h=Cc:Date:From:Reply-To:Subject:To; b=WxBuzh6nNSESdCc0G3PcEsdJFHoP4z2mzIzdygQaWt2zTqv+lSn15WfhWhFmWqm9evf 58XSgNWryy7GucAgO3DYvGcVP1nYqC0IJNLfU3beO556D8w1PBIucBEcNCoUEcq5nWKo2 oTr3P8amrDBSTJCfdO+80C6S2XxcBl8Dxv0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 command-line in UpdateArgcArgv. Cc: Ray Ni Cc: Linson Augustine Signed-off-by: Zhichao Gao Reviewed-by: Philippe Mathieu-Daude Reviewed-by: Ray Ni --- 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". --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51512): https://edk2.groups.io/g/devel/message/51512 Mute This Topic: https://groups.io/mt/64492759/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-