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