From: Chet Ramey Date: Thu, 9 Nov 2023 21:48:34 +0000 (-0500) Subject: Bash-5.2 patch 21: fix for expanding command substitutions in a word expansion in... X-Git-Tag: bash-5.3-alpha~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bb3cbefdb8fd019765b1a9cc42ecf37ff22fec6;p=thirdparty%2Fbash.git Bash-5.2 patch 21: fix for expanding command substitutions in a word expansion in a here-document --- diff --git a/patchlevel.h b/patchlevel.h index 2db9d9cea..1712b108f 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 20 +#define PATCHLEVEL 21 #endif /* _PATCHLEVEL_H_ */ diff --git a/subst.c b/subst.c index 1ac6eb2d9..0dfabfea9 100644 --- a/subst.c +++ b/subst.c @@ -1693,7 +1693,7 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags) t = extract_command_subst (string, &si, flags); CHECK_STRING_OVERRUN (i, si, slen, c); - tlen = si - i - 1; + tlen = si - i - 2; RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64); result[result_index++] = c; result[result_index++] = LPAREN; @@ -1713,7 +1713,7 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags) t = extract_process_subst (string, (string[i] == '<' ? "<(" : ">)"), &si, flags); CHECK_STRING_OVERRUN (i, si, slen, c); - tlen = si - i - 1; + tlen = si - i - 2; RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 4, result_size, 64); result[result_index++] = c; result[result_index++] = LPAREN;