From: Denys Vlasenko Date: Sat, 22 Feb 2020 15:39:27 +0000 (+0100) Subject: ash: parser: Fix old-style command substitution here-document crash X-Git-Tag: 1_32_0~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9a1a659707a18c29166c3e2977523102866d7aed;p=oweals%2Fbusybox.git ash: parser: Fix old-style command substitution here-document crash Upstream commit: Date: Fri, 29 Mar 2019 13:49:59 +0800 parser: Fix old-style command substitution here-document crash ... This is caused by the recent change to save/restore here-docment list around command substitutions. In doing so we must finish existing here-documents prior to restoring the old here-document list. This is done for new-style command substitutions but not for old-style. This patch fixes it by doing it for both. Fixes: 51e2d88d6e51 ("parser: Save/restore here-documents in...") Signed-off-by: Herbert Xu Signed-off-by: Denys Vlasenko --- diff --git a/shell/ash.c b/shell/ash.c index 005d87ecf..83cac3fb0 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -12877,9 +12877,9 @@ parsebackq: { if (readtoken() != TRP) raise_error_unexpected_syntax(TRP); setinputstring(nullstr); - parseheredoc(); } + parseheredoc(); heredoclist = saveheredoclist; (*nlpp)->n = n;