b130412
			     BASH PATCH REPORT
b130412
			     =================
b130412
b130412
Bash-Release: 3.2
b130412
Patch-ID: bash32-013
b130412
b130412
Bug-Reported-by: Magnus Svensson <msvensson@mysql.com>
b130412
Bug-Reference-ID: <45BDC44D.80609@mysql.com>
b130412
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html
b130412
b130412
Bug-Description:
b130412
b130412
Readline neglects to reallocate the array it uses to keep track of wrapped
b130412
screen lines when increasing its size.  This will eventually result in
b130412
segmentation faults when given sufficiently long input.
b130412
b130412
Patch:
b130412
b130412
*** ../bash-3.2-patched/lib/readline/display.c	Thu Sep 14 14:20:12 2006
b130412
--- lib/readline/display.c	Fri Feb  2 20:23:17 2007
b130412
***************
b130412
*** 561,574 ****
b130412
--- 561,586 ----
b130412
        wrap_offset = prompt_invis_chars_first_line = 0;
b130412
      }
b130412
  
b130412
+ #if defined (HANDLE_MULTIBYTE)
b130412
  #define CHECK_INV_LBREAKS() \
b130412
        do { \
b130412
  	if (newlines >= (inv_lbsize - 2)) \
b130412
  	  { \
b130412
  	    inv_lbsize *= 2; \
b130412
  	    inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
b130412
+ 	    _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
b130412
  	  } \
b130412
        } while (0)
b130412
+ #else
b130412
+ #define CHECK_INV_LBREAKS() \
b130412
+       do { \
b130412
+ 	if (newlines >= (inv_lbsize - 2)) \
b130412
+ 	  { \
b130412
+ 	    inv_lbsize *= 2; \
b130412
+ 	    inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
b130412
+ 	  } \
b130412
+       } while (0)
b130412
+ #endif /* HANDLE_MULTIBYTE */
b130412
  
b130412
  #if defined (HANDLE_MULTIBYTE)	  
b130412
  #define CHECK_LPOS() \
b130412
b130412
*** ../bash-3.2/patchlevel.h	Thu Apr 13 08:31:04 2006
b130412
--- patchlevel.h	Mon Oct 16 14:22:54 2006
b130412
***************
b130412
*** 26,30 ****
b130412
     looks for to find the patch level (for the sccs version string). */
b130412
  
b130412
! #define PATCHLEVEL 12
b130412
  
b130412
  #endif /* _PATCHLEVEL_H_ */
b130412
--- 26,30 ----
b130412
     looks for to find the patch level (for the sccs version string). */
b130412
  
b130412
! #define PATCHLEVEL 13
b130412
  
b130412
  #endif /* _PATCHLEVEL_H_ */