branch Attitude Adjustment packages
[12.09/packages.git] / utils / bash / patches / 121-upstream-bash42-021.patch
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-021
6
7 Bug-Reported-by:        Dan Douglas <ormaaj@gmail.com>
8 Bug-Reference-ID:       <4585554.nZWb4q7YoZ@smorgbox>
9 Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2011-12/msg00084.html
10
11 Bug-Description:
12
13 Using `read -N' to assign values to an array can result in NUL values being
14 assigned to some array elements.  These values cause seg faults when referenced
15 later.
16
17 Patch (apply with `patch -p0'):
18
19 --- a/builtins/read.def
20 +++ b/builtins/read.def
21 @@ -737,7 +737,7 @@ assign_vars:
22               xfree (t1);
23             }
24           else
25 -           var = bind_read_variable (varname, t);
26 +           var = bind_read_variable (varname, t ? t : "");
27         }
28        else
29         {
30 @@ -798,7 +798,7 @@ assign_vars:
31        xfree (t);
32      }
33    else
34 -    var = bind_read_variable (list->word->word, input_string);
35 +    var = bind_read_variable (list->word->word, input_string ? input_string : "");
36  
37    if (var)
38      {
39 --- a/patchlevel.h
40 +++ b/patchlevel.h
41 @@ -25,6 +25,6 @@
42     regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
43     looks for to find the patch level (for the sccs version string). */
44  
45 -#define PATCHLEVEL 20
46 +#define PATCHLEVEL 21
47  
48  #endif /* _PATCHLEVEL_H_ */