From d1a9d6286a3222ea44c8ade5f3db93c1a8d4b5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=9C=A8?= Date: Wed, 8 May 2024 17:09:12 +0800 Subject: [PATCH 1/2] fix for a crash if one of the expressions in an arithmetic for command expands to NULL (cherry picked from commit 4d779746e0cd6d6b6be3201ae818e617114c549d) --- ...if-one-of-the-expressions-in-an-arit.patch | 26 +++++++++++++++++++ bash.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Fix-for-a-crash-if-one-of-the-expressions-in-an-arit.patch diff --git a/Fix-for-a-crash-if-one-of-the-expressions-in-an-arit.patch b/Fix-for-a-crash-if-one-of-the-expressions-in-an-arit.patch new file mode 100644 index 0000000..6923a99 --- /dev/null +++ b/Fix-for-a-crash-if-one-of-the-expressions-in-an-arit.patch @@ -0,0 +1,26 @@ +From 708cc7f694738c6dde2dbb5317749a5a9e6d26e2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E8=82=96=E5=9C=A8?= +Date: Wed, 8 May 2024 17:04:43 +0800 +Subject: [PATCH] fix for a crash if one of the expressions in an arithmetic + for command expands to NULL + +--- + execute_cmd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index ce221a2..46b671d 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -3056,7 +3056,7 @@ eval_arith_for_expr (l, okp) + temp = expand_arith_string (expr, Q_DOUBLE_QUOTES|Q_ARITH); + if (l->next) + free (expr); +- new = make_word_list (make_word (temp), (WORD_LIST *)NULL); ++ new = make_word_list (make_word (temp ? temp : ""), (WORD_LIST *)NULL); + free (temp); + + if (new) +-- +2.33.0 + diff --git a/bash.spec b/bash.spec index e62afce..78ad22f 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,6 @@ Name: bash Version: 5.2.15 -Release: 8 +Release: 9 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -33,6 +33,7 @@ Patch6005: backport-fixes-for-LINENO-in-multi-line-simple-commands-print.patch Patch6006: backport-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch Patch6007: backport-renamed-several-functions-beginning-with-legal_-chan.patch Patch6008: backport-fix-for-cd-when-curent-directory-doesn-t-exist-fix-w.patch +Patch6009: Fix-for-a-crash-if-one-of-the-expressions-in-an-arit.patch BuildRequires: gcc bison texinfo autoconf ncurses-devel # Required for bash tests @@ -161,6 +162,9 @@ make check %exclude %{_infodir}/dir %changelog +* Wed May 08 2024 xiaozai -5.2.15-8 +- fix for a crash if one of the expressions in an arithmetic for command expands to NULL + * Fri Apr 26 2024 wangyuhang -5.2.15-8 - sync patches from bash community -- Gitee From e577de049a5280b25f10d35c68d3e67b0ce1e744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=9C=A8?= Date: Wed, 8 May 2024 09:33:06 +0000 Subject: [PATCH 2/2] update bash.spec. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 肖在 (cherry picked from commit 5e8dacfd36835c1b556ced01e4be03b8f00dc65f) --- bash.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.spec b/bash.spec index 78ad22f..208e4d3 100644 --- a/bash.spec +++ b/bash.spec @@ -162,7 +162,7 @@ make check %exclude %{_infodir}/dir %changelog -* Wed May 08 2024 xiaozai -5.2.15-8 +* Wed May 08 2024 xiaozai -5.2.15-9 - fix for a crash if one of the expressions in an arithmetic for command expands to NULL * Fri Apr 26 2024 wangyuhang -5.2.15-8 -- Gitee