summaryrefslogtreecommitdiff
path: root/source/a/bash/bash-4.2-patches/bash42-039
blob: 21457af12bc52d19e90b27fa02f55d148e186d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
			     BASH PATCH REPORT
			     =================

Bash-Release:	4.2
Patch-ID:	bash42-039

Bug-Reported-by:	Dan Douglas <ormaaj@gmail.com>
Bug-Reference-ID:	<1498458.MpVlmOXDB7@smorgbox>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html

Bug-Description:

Under certain circumstances, bash attempts to expand variables in arithmetic
expressions even when evaluation is being suppressed.

Patch (apply with `patch -p0'):

*** ../bash-4.2-patched/expr.c	2011-11-21 18:03:35.000000000 -0500
--- expr.c	2012-09-09 16:31:18.000000000 -0400
***************
*** 1010,1013 ****
--- 1073,1082 ----
  #endif
  
+ /*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
+   /* If we are suppressing evaluation, just short-circuit here instead of
+      going through the rest of the evaluator. */
+   if (noeval)
+     return (0);
+ 
    /* [[[[[ */
  #if defined (ARRAY_VARS)
***************
*** 1183,1186 ****
--- 1256,1263 ----
  
        *cp = '\0';
+       /* XXX - watch out for pointer aliasing issues here */
+       if (curlval.tokstr && curlval.tokstr == tokstr)
+ 	init_lvalue (&curlval);
+ 
        FREE (tokstr);
        tokstr = savestring (tp);
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
--- patchlevel.h	Thu Feb 24 21:41:34 2011
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 38
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 39
  
  #endif /* _PATCHLEVEL_H_ */