public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Paul Koning <paulkoning@comcast.net>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb] fix unsigned overflow in charset.c
Date: Tue, 09 Oct 2018 17:31:00 -0000	[thread overview]
Message-ID: <1acace4a-a5c6-abaf-f070-9c2e6768b6f2@redhat.com> (raw)
In-Reply-To: <7B48D309-445E-4141-A87A-1F3D5FA70EFD@comcast.net>

On 10/09/2018 06:19 PM, Paul Koning wrote:
> This fixed an overflow in pointer arithmetic that crashes GDB on Mac OS.

_unsigned_ overflow?  That isn't undefined.  Do we really want to trap
those?  I don't think GCC's version does that.

From: 
  https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#silencing-unsigned-integer-overflow
seems like there's a way to disable it.

Thanks,
Pedro Alves


> 
> Ok for trunk?
> 
> 	paul
> 
> gdb/ChangeLog:
> 
> 2018-10-09  Paul Koning  <paul_koning@dell.com>
> 
> 	* charset.c (convert_between_encodings): Fix unsigned overflow.
> 
> diff --git a/gdb/charset.c b/gdb/charset.c
> index 8bb2b4d669..64757ab279 100644
> --- a/gdb/charset.c
> +++ b/gdb/charset.c
> @@ -548,7 +548,7 @@ convert_between_encodings (const char *from, const char *to,
>  
>        /* Now make sure that the object on the obstack only includes
>  	 bytes we have converted.  */
> -      obstack_blank_fast (output, -outleft);
> +      obstack_blank_fast (output, -(ssize_t) outleft);
>  
>        if (r == (size_t) -1)
>  	{
> 

  reply	other threads:[~2018-10-09 17:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 17:19 Paul Koning
2018-10-09 17:31 ` Pedro Alves [this message]
2018-10-09 17:40   ` Paul Koning
2018-10-09 17:57     ` John Baldwin
2018-10-09 18:10       ` Paul Koning
2018-10-09 19:58         ` John Baldwin
2018-10-10  8:51           ` Pedro Alves
2018-10-11 20:16             ` John Baldwin
2018-10-16 15:58               ` Pedro Alves
2018-10-17 18:38                 ` John Baldwin
2018-10-17 18:47                   ` Paul Koning
2018-10-17 21:51                     ` Pedro Alves
2018-10-17 23:28                       ` Paul Koning

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-all 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=1acace4a-a5c6-abaf-f070-9c2e6768b6f2@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=paulkoning@comcast.net \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).