public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kinney, Michael D" <michael.d.kinney@intel.com>
To: "Wang, Jian J" <jian.j.wang@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH v2 0/2] Fix error in PrintLib
Date: Fri, 29 Dec 2017 01:07:52 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5A7DF34A4@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <20171228023828.18752-1-jian.j.wang@intel.com>

Jian,

This change breaks GCC5 builds.

/home/mdkinney/tianocore/edk2/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c: In function 'InternalPrintLibSPrintMarker':
/home/mdkinney/tianocore/edk2/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c:2054:71: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
             ArgumentString[Count * BytesPerArgumentCharacter] != '\0' &&
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
             Count < Precision || ((Flags & PRECISION) == 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
> 
> > v2:
> >    a. Correct incorrect description in commit log
> >    b. Fix another similar issue in the same function
> >    c. Fix similar issues in
> MdeModulePkg/DxePrintLibPrint2Protocol
> 
> 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.
> 
> Jian J Wang (2):
>   MdePkg/BasePrintLib: Fix error in Precision position
> calculation
>   MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential
> string over read
> 
> 
> MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib
> .c | 7 +++++--
>  MdePkg/Library/BasePrintLib/PrintLibInternal.c
> | 7 +++++--
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> --
> 2.15.1.windows.2
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  parent reply	other threads:[~2017-12-29  1:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28  2:38 [PATCH v2 0/2] Fix error in PrintLib Jian J Wang
2017-12-28  2:38 ` [PATCH v2 1/2] MdePkg/BasePrintLib: Fix error in Precision position calculation Jian J Wang
     [not found]   ` <CAKv+Gu_W-0etAXve+1Vn-hDL9A-9Oror-L6nCtt9_UqRxkhhCw@mail.gmail.com>
2018-01-02  8:23     ` Wang, Jian J
2017-12-28  2:38 ` [PATCH v2 2/2] MdeModulePkg/DxePrintLibPrint2Protocol: Fix potential string over read Jian J Wang
2017-12-28  2:43 ` [PATCH v2 0/2] Fix error in PrintLib Gao, Liming
2017-12-28  3:10 ` Zeng, Star
2017-12-29  1:07 ` Kinney, Michael D [this message]
2017-12-29  1:41   ` Wang, Jian J

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E92EE9817A31E24EB0585FDF735412F5A7DF34A4@ORSMSX113.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox