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.100; helo=mga07.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 0483821A1098A for ; Thu, 28 Dec 2017 17:02:56 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Dec 2017 17:07:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,473,1508828400"; d="scan'208";a="22225512" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga002.jf.intel.com with ESMTP; 28 Dec 2017 17:07:53 -0800 Received: from orsmsx158.amr.corp.intel.com (10.22.240.20) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Dec 2017 17:07:53 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.187]) by ORSMSX158.amr.corp.intel.com ([169.254.10.25]) with mapi id 14.03.0319.002; Thu, 28 Dec 2017 17:07:53 -0800 From: "Kinney, Michael D" To: "Wang, Jian J" , "edk2-devel@lists.01.org" , "Kinney, Michael D" Thread-Topic: [edk2] [PATCH v2 0/2] Fix error in PrintLib Thread-Index: AQHTf4UBIP6zu2ctjkSdTpS3ZQee36NZg1aA Date: Fri, 29 Dec 2017 01:07:52 +0000 Message-ID: References: <20171228023828.18752-1-jian.j.wang@intel.com> In-Reply-To: <20171228023828.18752-1-jian.j.wang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [PATCH v2 0/2] Fix error in PrintLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2017 01:02:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jian, This change breaks GCC5 builds. /home/mdkinney/tianocore/edk2/MdeModulePkg/Library/DxePrintLibPrint2Protoco= l/PrintLib.c: In function 'InternalPrintLibSPrintMarker': /home/mdkinney/tianocore/edk2/MdeModulePkg/Library/DxePrintLibPrint2Protoco= l/PrintLib.c:2054:71: error: suggest parentheses around '&&' within '||' [-= Werror=3Dparentheses] ArgumentString[Count * BytesPerArgumentCharacter] !=3D '\0' && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ Count < Precision || ((Flags & PRECISION) =3D=3D 0); ~~~~~~~~~~~~~~~~~ Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel- > bounces@lists.01.org] On Behalf Of Jian J Wang > Sent: Wednesday, December 27, 2017 6:38 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH v2 0/2] Fix error in PrintLib >=20 > > v2: > > a. Correct incorrect description in commit log > > b. Fix another similar issue in the same function > > c. Fix similar issues in > MdeModulePkg/DxePrintLibPrint2Protocol >=20 > Due to a potential hole in the stop condition of the > loop, the two continuous > access to ArgumentString (index, index+1) inside the > loop might cause the > string ending character ('\0') and the byte after it to > be read. >=20 > Jian J Wang (2): > MdePkg/BasePrintLib: Fix error in Precision position > calculation > MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential > string over read >=20 >=20 > MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib > .c | 7 +++++-- > MdePkg/Library/BasePrintLib/PrintLibInternal.c > | 7 +++++-- > 2 files changed, 10 insertions(+), 4 deletions(-) >=20 > -- > 2.15.1.windows.2 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel