7 Bug-Reported-by: Norbert Lange <nolange79@gmail.com>
8 Bug-Reference-ID: <CADYdroPZFdVZSL6KkhqkAPgKKopbsLQVSm7_TvLCwadL2=UAWw@mail.gmail.com>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-12/msg00046.html
13 There is an off-by-one error that causes command substitutions to fail when
14 they appear in a word expansion inside a here-document.
16 Patch (apply with `patch -p0'):
18 *** ../bash-5.2-patched/subst.c 2022-12-13 12:08:58.000000000 -0500
19 --- subst.c 2022-12-14 09:09:53.000000000 -0500
22 CHECK_STRING_OVERRUN (i, si, slen, c);
25 RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64);
26 result[result_index++] = c;
28 CHECK_STRING_OVERRUN (i, si, slen, c);
31 RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64);
32 result[result_index++] = c;
35 CHECK_STRING_OVERRUN (i, si, slen, c);
38 RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64);
39 result[result_index++] = c;
41 CHECK_STRING_OVERRUN (i, si, slen, c);
44 RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64);
45 result[result_index++] = c;
47 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
48 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
51 looks for to find the patch level (for the sccs version string). */
53 ! #define PATCHLEVEL 20
55 #endif /* _PATCHLEVEL_H_ */
57 looks for to find the patch level (for the sccs version string). */
59 ! #define PATCHLEVEL 21
61 #endif /* _PATCHLEVEL_H_ */