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-023
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Bug-Reported-by:	Chet Ramey <chet.ramey@cwru.edu>
Tomas Janousek 5a0cfd
Bug-Reference-ID:
Tomas Janousek 5a0cfd
Bug-Reference-URL:
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Bug-Description:
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
When an error occurs during the pattern removal word expansion, the shell
Tomas Janousek 5a0cfd
can free unallocated memory or free memory multiple times.
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
Patch:
Tomas Janousek 5a0cfd
Tomas Janousek 5a0cfd
*** ../bash-3.2-patched/subst.c	Tue Apr  3 16:47:19 2007
Tomas Janousek 5a0cfd
--- subst.c	Tue Jul 17 09:45:11 2007
Tomas Janousek 5a0cfd
***************
Tomas Janousek 5a0cfd
*** 3975,3979 ****
Tomas Janousek 5a0cfd
      patstr++;
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
!   pattern = getpattern (patstr, quoted, 1);
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
    temp1 = (char *)NULL;		/* shut up gcc */
Tomas Janousek 5a0cfd
--- 4008,4016 ----
Tomas Janousek 5a0cfd
      patstr++;
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
!   /* Need to pass getpattern newly-allocated memory in case of expansion --
Tomas Janousek 5a0cfd
!      the expansion code will free the passed string on an error. */
Tomas Janousek 5a0cfd
!   temp1 = savestring (patstr);
Tomas Janousek 5a0cfd
!   pattern = getpattern (temp1, quoted, 1);
Tomas Janousek 5a0cfd
!   free (temp1);
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
    temp1 = (char *)NULL;		/* shut up gcc */
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 22
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 23
Tomas Janousek 5a0cfd
  
Tomas Janousek 5a0cfd
  #endif /* _PATCHLEVEL_H_ */