90f71c6b5edb1d96743742cf50224f58c8752215
[packages.git] / utils / bash / patches / 117-upstream-bash42-017.patch
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-017
6
7 Bug-Reported-by:        Curtis Doty <Curtis@GreenKey.net>
8 Bug-Reference-ID:       <20110621035324.A4F70849F59@mx1.iParadigms.net>
9 Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00053.html
10
11 Bug-Description:
12
13 Using `read -a foo' where foo was an already-declared associative array
14 caused the shell to die with a segmentation fault.
15
16 Patch (apply with `patch -p0'):
17
18 --- a/builtins/read.def
19 +++ b/builtins/read.def
20 @@ -642,6 +642,12 @@ assign_vars:
21           xfree (input_string);
22           return EXECUTION_FAILURE;     /* readonly or noassign */
23         }
24 +      if (assoc_p (var))
25 +       {
26 +          builtin_error (_("%s: cannot convert associative to indexed array"), arrayname);
27 +         xfree (input_string);
28 +         return EXECUTION_FAILURE;     /* existing associative array */
29 +       }
30        array_flush (array_cell (var));
31  
32        alist = list_string (input_string, ifs_chars, 0);
33 --- a/patchlevel.h
34 +++ b/patchlevel.h
35 @@ -25,6 +25,6 @@
36     regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
37     looks for to find the patch level (for the sccs version string). */
38  
39 -#define PATCHLEVEL 16
40 +#define PATCHLEVEL 17
41  
42  #endif /* _PATCHLEVEL_H_ */