~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to debian/patches/bash42-039.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
                             BASH PATCH REPORT
2
 
                             =================
3
 
 
4
 
Bash-Release:   4.2
5
 
Patch-ID:       bash42-039
6
 
 
7
 
Bug-Reported-by:        Dan Douglas <ormaaj@gmail.com>
8
 
Bug-Reference-ID:       <1498458.MpVlmOXDB7@smorgbox>
9
 
Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html
10
 
 
11
 
Bug-Description:
12
 
 
13
 
Under certain circumstances, bash attempts to expand variables in arithmetic
14
 
expressions even when evaluation is being suppressed.
15
 
 
16
 
Patch (apply with `patch -p0'):
17
 
 
18
 
Index: b/bash/expr.c
19
 
===================================================================
20
 
--- a/bash/expr.c
21
 
+++ b/bash/expr.c
22
 
@@ -1009,6 +1009,12 @@
23
 
   arrayind_t ind;
24
 
 #endif
25
 
 
26
 
+/*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
27
 
+  /* If we are suppressing evaluation, just short-circuit here instead of
28
 
+     going through the rest of the evaluator. */
29
 
+  if (noeval)
30
 
+    return (0);
31
 
+
32
 
   /* [[[[[ */
33
 
 #if defined (ARRAY_VARS)
34
 
   v = (e == ']') ? array_variable_part (tok, (char **)0, (int *)0) : find_variable (tok);
35
 
@@ -1182,6 +1188,10 @@
36
 
 #endif /* ARRAY_VARS */
37
 
 
38
 
       *cp = '\0';
39
 
+      /* XXX - watch out for pointer aliasing issues here */
40
 
+      if (curlval.tokstr && curlval.tokstr == tokstr)
41
 
+       init_lvalue (&curlval);
42
 
+
43
 
       FREE (tokstr);
44
 
       tokstr = savestring (tp);
45
 
       *cp = c;
46
 
Index: b/bash/patchlevel.h
47
 
===================================================================
48
 
--- a/bash/patchlevel.h
49
 
+++ b/bash/patchlevel.h
50
 
@@ -25,6 +25,6 @@
51
 
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
52
 
    looks for to find the patch level (for the sccs version string). */
53
 
 
54
 
-#define PATCHLEVEL 38
55
 
+#define PATCHLEVEL 39
56
 
 
57
 
 #endif /* _PATCHLEVEL_H_ */