Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Kevin Buettner <kevinb@redhat.com>,
	 gdb-patches@sourceware.org,  Saagar Jha <saagar@saagarjha.com>
Subject: Re: [PATCH] Prevent overflow in rl_set_screen_size
Date: Fri, 15 Feb 2019 20:19:00 -0000	[thread overview]
Message-ID: <87wom0yfcb.fsf@tromey.com> (raw)
In-Reply-To: <9e42397a-e3a5-0296-d239-70f4c7c0d215@redhat.com> (Pedro Alves's	message of "Fri, 15 Feb 2019 09:39:49 +0000")

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> so if the function takes int parameters without specifying an upper bound, it
Pedro> seems like a readline bug to me to not consider large numbers.

True, though it doesn't hurt to also check in gdb.

What's funny is that readline *does* check for negative values:

  if (rows > 0)
    _rl_screenheight = rows;
  .. etc ..

So gdb's approach:

  if (rows <= 0)
    rows = INT_MAX;

... actively works around the existing checks in readline.

Tom


  parent reply	other threads:[~2019-02-15 20:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27  4:56 Saagar Jha
2019-02-15  1:52 ` Kevin Buettner
2019-02-15  9:40   ` Pedro Alves
2019-02-15 10:52     ` Saagar Jha
2019-02-15 20:19     ` Tom Tromey [this message]
     [not found]       ` <d3e1b041-9802-1fb2-2d5f-73590287610e@redhat.com>
2019-02-20 17:22         ` Pedro Alves
2019-02-20 17:37           ` [PATCH 2/2] Make 'show width/height' display "unlimited" when capped, for readline (Re: [PATCH] Prevent overflow in rl_set_screen_size) Pedro Alves
2019-02-20 21:04             ` Tom Tromey
2019-02-20 23:02               ` Kevin Buettner
2019-02-27 18:51                 ` Pedro Alves
2019-02-27 18:52                   ` [PATCH] Test "set width/height -1" (Re: [PATCH 2/2] Make 'show width/height' display "unlimited" when capped for readline) Pedro Alves

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=87wom0yfcb.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=palves@redhat.com \
    --cc=saagar@saagarjha.com \
    /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