a0fe47e
			   READLINE PATCH REPORT
a0fe47e
			   =====================
a0fe47e
a0fe47e
Readline-Release: 5.2
a0fe47e
Patch-ID: readline52-002
a0fe47e
a0fe47e
Bug-Reported-by: Magnus Svensson <msvensson@mysql.com>
a0fe47e
Bug-Reference-ID: <45BDC44D.80609@mysql.com>
a0fe47e
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html
a0fe47e
a0fe47e
Bug-Description:
a0fe47e
a0fe47e
Readline neglects to reallocate the array it uses to keep track of wrapped
a0fe47e
screen lines when increasing its size.  This will eventually result in
a0fe47e
segmentation faults when given sufficiently long input.
a0fe47e
a0fe47e
Patch:
a0fe47e
a0fe47e
*** ../readline-5.2-patched/display.c	Thu Sep 14 14:20:12 2006
a0fe47e
--- display.c	Fri Feb  2 20:23:17 2007
a0fe47e
***************
a0fe47e
*** 561,574 ****
a0fe47e
--- 561,586 ----
a0fe47e
        wrap_offset = prompt_invis_chars_first_line = 0;
a0fe47e
      }
a0fe47e
  
a0fe47e
+ #if defined (HANDLE_MULTIBYTE)
a0fe47e
  #define CHECK_INV_LBREAKS() \
a0fe47e
        do { \
a0fe47e
  	if (newlines >= (inv_lbsize - 2)) \
a0fe47e
  	  { \
a0fe47e
  	    inv_lbsize *= 2; \
a0fe47e
  	    inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
a0fe47e
+ 	    _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
a0fe47e
  	  } \
a0fe47e
        } while (0)
a0fe47e
+ #else
a0fe47e
+ #define CHECK_INV_LBREAKS() \
a0fe47e
+       do { \
a0fe47e
+ 	if (newlines >= (inv_lbsize - 2)) \
a0fe47e
+ 	  { \
a0fe47e
+ 	    inv_lbsize *= 2; \
a0fe47e
+ 	    inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
a0fe47e
+ 	  } \
a0fe47e
+       } while (0)
a0fe47e
+ #endif /* HANDLE_MULTIBYTE */
a0fe47e
  
a0fe47e
  #if defined (HANDLE_MULTIBYTE)	  
a0fe47e
  #define CHECK_LPOS() \