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