7 Bug-Reported-by: Alexander Mescheryakov <alexander.s.m@gmail.com>,
8 konsolebox <konsolebox@gmail.com>
9 Bug-Reference-ID: <5ffd7f3d.1c69fb81.dee25.166c@mx.google.com>,
10 <CAJnmqwaVs7M6NBqZzcHy5c2+yHkTEg7p+o8ZWuA7sN+6N1q4CA@mail.gmail.com>
11 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2021-01/msg00082.html,
12 https://lists.gnu.org/archive/html/bug-bash/2021-04/msg00160.html
16 Fix two memory leaks when assigning arrays using compound assignment syntax.
18 Patch (apply with `patch -p0'):
20 *** ../bash-5.1-patched/subst.c 2020-12-16 17:01:32.000000000 -0500
21 --- subst.c 2021-01-24 17:48:40.000000000 -0500
26 value = string_list (l);
29 wlen = STRLEN (value);
31 *** ../bash-5.1-patched/arrayfunc.c 2020-12-16 17:01:32.000000000 -0500
32 --- arrayfunc.c 2021-04-19 16:43:09.000000000 -0400
36 char *akey, *aval, *k, *v;
39 for (list = nlist; list; list = list->next)
44 v = list->next ? list->next->word->word : 0;
49 akey = expand_assignment_string_to_string (k, 0);
50 - aval = expand_assignment_string_to_string (v, 0);
52 if (akey == 0 || *akey == 0)
61 aval = (char *)xmalloc (1);
62 aval[0] = '\0'; /* like do_assignment_internal */
66 bind_assoc_var_internal (var, h, akey, aval, flags);
75 + aval = expand_assignment_string_to_string (v, 0);
78 aval = (char *)xmalloc (1);
79 aval[0] = '\0'; /* like do_assignment_internal */
82 bind_assoc_var_internal (var, h, akey, aval, flags);
86 *** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
87 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
90 looks for to find the patch level (for the sccs version string). */
92 ! #define PATCHLEVEL 4
94 #endif /* _PATCHLEVEL_H_ */
96 looks for to find the patch level (for the sccs version string). */
98 ! #define PATCHLEVEL 5
100 #endif /* _PATCHLEVEL_H_ */