From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 1B2DA2034A7B8 for ; Wed, 25 Oct 2017 18:39:06 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2017 18:42:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,433,1503385200"; d="scan'208";a="1235384362" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 25 Oct 2017 18:42:51 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Oct 2017 18:42:50 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Oct 2017 18:42:51 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Thu, 26 Oct 2017 09:42:48 +0800 From: "Wu, Hao A" To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] Shellpkg/editor: Fix a bug that may modifies Line[-1] Thread-Index: AQHTTS0M1tpagK4SZUOhhsvZiSkCsaL1W8pAgAABABA= Date: Thu, 26 Oct 2017 01:42:47 +0000 Message-ID: References: <20171025010308.53424-1-ruiyu.ni@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] Shellpkg/editor: Fix a bug that may modifies Line[-1] X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 01:39:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please ignore the mail titled with: [edk2] Recall: [PATCH] Shellpkg/editor: Fix a bug that may modifies Line[-1= ] Since I received a notification that my previous r-b mail was rejected by the edk2-devel mailing list. Sorry for the noise. Best Regards, Hao Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Wu= , > Hao A > Sent: Thursday, October 26, 2017 9:38 AM > To: Ni, Ruiyu; edk2-devel@lists.01.org > Cc: Carsey, Jaben > Subject: Re: [edk2] [PATCH] Shellpkg/editor: Fix a bug that may modifies = Line[-1] >=20 > Reviewed-by: Hao Wu >=20 > Best Regards, > Hao Wu >=20 > > -----Original Message----- > > From: Ni, Ruiyu > > Sent: Wednesday, October 25, 2017 9:03 AM > > To: edk2-devel@lists.01.org > > Cc: Carsey, Jaben; Wu, Hao A > > Subject: [PATCH] Shellpkg/editor: Fix a bug that may modifies Line[-1] > > > > The original code as below intend to set the character > > before last column to CHAR_NULL. > > Line[(LastCol % (ARRAY_SIZE (Line) - 1)) - 1] =3D CHAR_NULL; > > > > But when LastCol % (ARRAY_SIZE (Line) - 1)) equals to 0, > > Line[-1] is modified. > > > > We should change to code as below: > > Line[(LastCol - 1) % (ARRAY_SIZE (Line) - 1)] =3D CHAR_NULL; > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Ruiyu Ni > > Cc: Jaben Carsey > > Cc: Hao A Wu > > --- > > .../Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c > | > > 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git > > > a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands > > Lib.c > > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands > > Lib.c > > index d26d08f95c..b45e9a33f3 100644 > > --- > > > a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands > > Lib.c > > +++ > > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands > > Lib.c > > @@ -205,7 +205,7 @@ EditorClearLine ( > > // > > // if CHAR_NULL is still at position LastCol, it will cause fi= rst line error > > // > > - Line[(LastCol % (ARRAY_SIZE (Line) - 1)) - 1] =3D CHAR_NULL; > > + Line[(LastCol - 1) % (ARRAY_SIZE (Line) - 1)] =3D CHAR_NULL; > > } else { > > Line[LastCol % (ARRAY_SIZE (Line) - 1)] =3D CHAR_NULL; > > } > > -- > > 2.12.2.windows.2 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel