Roman Rakus 6c0043
			     BASH PATCH REPORT
Roman Rakus 6c0043
			     =================
Roman Rakus 6c0043
Roman Rakus 6c0043
Bash-Release:	4.2
Roman Rakus 6c0043
Patch-ID:	bash42-033
Roman Rakus 6c0043
Roman Rakus 6c0043
Bug-Reported-by:	David Leverton <levertond@googlemail.com>
Roman Rakus 6c0043
Bug-Reference-ID:	<4FCCE737.1060603@googlemail.com>
Roman Rakus 6c0043
Bug-Reference-URL:
Roman Rakus 6c0043
Roman Rakus 6c0043
Bug-Description:
Roman Rakus 6c0043
Roman Rakus 6c0043
Bash uses a static buffer when expanding the /dev/fd prefix for the test
Roman Rakus 6c0043
and conditional commands, among other uses, when it should use a dynamic
Roman Rakus 6c0043
buffer to avoid buffer overflow.
Roman Rakus 6c0043
Roman Rakus 6c0043
Patch (apply with `patch -p0'):
Roman Rakus 6c0043
Roman Rakus 6c0043
*** ../bash-4.2-patched/lib/sh/eaccess.c	2011-01-08 20:50:10.000000000 -0500
Roman Rakus 6c0043
--- lib/sh/eaccess.c	2012-06-04 21:06:43.000000000 -0400
Roman Rakus 6c0043
***************
Roman Rakus 6c0043
*** 83,86 ****
Roman Rakus 6c0043
--- 83,88 ----
Roman Rakus 6c0043
       struct stat *finfo;
Roman Rakus 6c0043
  {
Roman Rakus 6c0043
+   static char *pbuf = 0;
Roman Rakus 6c0043
+ 
Roman Rakus 6c0043
    if (*path == '\0')
Roman Rakus 6c0043
      {
Roman Rakus 6c0043
***************
Roman Rakus 6c0043
*** 107,111 ****
Roman Rakus 6c0043
       On most systems, with the notable exception of linux, this is
Roman Rakus 6c0043
       effectively a no-op. */
Roman Rakus 6c0043
!       char pbuf[32];
Roman Rakus 6c0043
        strcpy (pbuf, DEV_FD_PREFIX);
Roman Rakus 6c0043
        strcat (pbuf, path + 8);
Roman Rakus 6c0043
--- 109,113 ----
Roman Rakus 6c0043
       On most systems, with the notable exception of linux, this is
Roman Rakus 6c0043
       effectively a no-op. */
Roman Rakus 6c0043
!       pbuf = xrealloc (pbuf, sizeof (DEV_FD_PREFIX) + strlen (path + 8));
Roman Rakus 6c0043
        strcpy (pbuf, DEV_FD_PREFIX);
Roman Rakus 6c0043
        strcat (pbuf, path + 8);
Roman Rakus 6c0043
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
Roman Rakus 6c0043
--- patchlevel.h	Thu Feb 24 21:41:34 2011
Roman Rakus 6c0043
***************
Roman Rakus 6c0043
*** 26,30 ****
Roman Rakus 6c0043
     looks for to find the patch level (for the sccs version string). */
Roman Rakus 6c0043
  
Roman Rakus 6c0043
! #define PATCHLEVEL 32
Roman Rakus 6c0043
  
Roman Rakus 6c0043
  #endif /* _PATCHLEVEL_H_ */
Roman Rakus 6c0043
--- 26,30 ----
Roman Rakus 6c0043
     looks for to find the patch level (for the sccs version string). */
Roman Rakus 6c0043
  
Roman Rakus 6c0043
! #define PATCHLEVEL 33
Roman Rakus 6c0043
  
Roman Rakus 6c0043
  #endif /* _PATCHLEVEL_H_ */