This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Prevent overflow in rl_set_screen_size
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Kevin Buettner <kevinb at redhat dot com>, gdb-patches at sourceware dot org, Saagar Jha <saagar at saagarjha dot com>
- Date: Fri, 15 Feb 2019 13:19:32 -0700
- Subject: Re: [PATCH] Prevent overflow in rl_set_screen_size
- References: <A2D1267E-9CB0-49C2-B3AC-4F880A7951E2@saagarjha.com> <20190214185254.15369a0a@f29-4.lan> <9e42397a-e3a5-0296-d239-70f4c7c0d215@redhat.com>
>>>>> "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