5 Patch-ID: readline52-002
7 Bug-Reported-by: Magnus Svensson <msvensson@mysql.com>
8 Bug-Reference-ID: <45BDC44D.80609@mysql.com>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html
13 Readline neglects to reallocate the array it uses to keep track of wrapped
14 screen lines when increasing its size. This will eventually result in
15 segmentation faults when given sufficiently long input.
19 *** ../readline-5.2-patched/display.c Thu Sep 14 14:20:12 2006
20 --- display.c Fri Feb 2 20:23:17 2007
24 wrap_offset = prompt_invis_chars_first_line = 0;
27 + #if defined (HANDLE_MULTIBYTE)
28 #define CHECK_INV_LBREAKS() \
30 if (newlines >= (inv_lbsize - 2)) \
33 inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
34 + _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
38 + #define CHECK_INV_LBREAKS() \
40 + if (newlines >= (inv_lbsize - 2)) \
43 + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
46 + #endif /* HANDLE_MULTIBYTE */
48 #if defined (HANDLE_MULTIBYTE)
49 #define CHECK_LPOS() \