svashisht / rpms / bash

Forked from rpms/bash 6 years ago
Clone
Roman Rakus f15e01c
			     BASH PATCH REPORT
Roman Rakus f15e01c
			     =================
Roman Rakus f15e01c
Roman Rakus f15e01c
Bash-Release:	4.2
Roman Rakus f15e01c
Patch-ID:	bash42-039
Roman Rakus f15e01c
Roman Rakus f15e01c
Bug-Reported-by:	Dan Douglas <ormaaj@gmail.com>
Roman Rakus f15e01c
Bug-Reference-ID:	<1498458.MpVlmOXDB7@smorgbox>
Roman Rakus f15e01c
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html
Roman Rakus f15e01c
Roman Rakus f15e01c
Bug-Description:
Roman Rakus f15e01c
Roman Rakus f15e01c
Under certain circumstances, bash attempts to expand variables in arithmetic
Roman Rakus f15e01c
expressions even when evaluation is being suppressed.
Roman Rakus f15e01c
Roman Rakus f15e01c
Patch (apply with `patch -p0'):
Roman Rakus f15e01c
Roman Rakus f15e01c
*** ../bash-4.2-patched/expr.c	2011-11-21 18:03:35.000000000 -0500
Roman Rakus f15e01c
--- expr.c	2012-09-09 16:31:18.000000000 -0400
Roman Rakus f15e01c
***************
Roman Rakus f15e01c
*** 1010,1013 ****
Roman Rakus f15e01c
--- 1073,1082 ----
Roman Rakus f15e01c
  #endif
Roman Rakus f15e01c
  
Roman Rakus f15e01c
+ /*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
Roman Rakus f15e01c
+   /* If we are suppressing evaluation, just short-circuit here instead of
Roman Rakus f15e01c
+      going through the rest of the evaluator. */
Roman Rakus f15e01c
+   if (noeval)
Roman Rakus f15e01c
+     return (0);
Roman Rakus f15e01c
+ 
Roman Rakus f15e01c
    /* [[[[[ */
Roman Rakus f15e01c
  #if defined (ARRAY_VARS)
Roman Rakus f15e01c
***************
Roman Rakus f15e01c
*** 1183,1186 ****
Roman Rakus f15e01c
--- 1256,1263 ----
Roman Rakus f15e01c
  
Roman Rakus f15e01c
        *cp = '\0';
Roman Rakus f15e01c
+       /* XXX - watch out for pointer aliasing issues here */
Roman Rakus f15e01c
+       if (curlval.tokstr && curlval.tokstr == tokstr)
Roman Rakus f15e01c
+ 	init_lvalue (&curlval);
Roman Rakus f15e01c
+ 
Roman Rakus f15e01c
        FREE (tokstr);
Roman Rakus f15e01c
        tokstr = savestring (tp);
Roman Rakus f15e01c
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
Roman Rakus f15e01c
--- patchlevel.h	Thu Feb 24 21:41:34 2011
Roman Rakus f15e01c
***************
Roman Rakus f15e01c
*** 26,30 ****
Roman Rakus f15e01c
     looks for to find the patch level (for the sccs version string). */
Roman Rakus f15e01c
  
Roman Rakus f15e01c
! #define PATCHLEVEL 38
Roman Rakus f15e01c
  
Roman Rakus f15e01c
  #endif /* _PATCHLEVEL_H_ */
Roman Rakus f15e01c
--- 26,30 ----
Roman Rakus f15e01c
     looks for to find the patch level (for the sccs version string). */
Roman Rakus f15e01c
  
Roman Rakus f15e01c
! #define PATCHLEVEL 39
Roman Rakus f15e01c
  
Roman Rakus f15e01c
  #endif /* _PATCHLEVEL_H_ */