This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug-readline] heap-buffer-overflow in update_line


On 5/17/19 10:59 AM, Tom de Vries wrote:

> Either way, I'm open for suggestions that make gdb call
> rl_set_screen_size with legal parameters, and disable features like
> horizontal scrolling to get unformatted output for the testsuite run.

Here's a patch that will prevent the huge values for the screen width from
causing at least one issue with line_size:

*** ../readline-8.0-patched/display.c	2018-09-30 21:37:48.000000000 -0400
--- display.c	2019-05-16 16:50:44.000000000 -0400
***************
*** 604,607 ****
--- 604,610 ----
    register int n;

+   if (line_size <= _rl_screenwidth)	/* XXX - for gdb */
+     line_size = _rl_screenwidth + 1;
+
    if (invisible_line == 0)	/* initialize it */
      {

You're still going to have to deal with some horizontal scrolling if the
input line gets long enough.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]