From e35bd0c60275c5ed8b327f87f1a69fd881344d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=9C=A8?= Date: Tue, 7 May 2024 17:49:02 +0800 Subject: [PATCH] fix for a crash if one of the expressions in an arithmetic for command expands to NULL --- ...if-one-of-the-expressions-in-an-arit.patch | 39 +++++++++++++++++++ bash.spec | 11 ++---- 2 files changed, 42 insertions(+), 8 deletions(-) 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..b2c9726 --- /dev/null +++ b/Fix-for-a-crash-if-one-of-the-expressions-in-an-arit.patch @@ -0,0 +1,39 @@ +From 66067ff7da8fa52deb401e530b0be7ae302396d5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E8=82=96=E5=9C=A8?= +Date: Tue, 7 May 2024 17:37:29 +0800 +Subject: [PATCH] fix for a crash if one of the expressions in an arithmetic + for command expands to NULL + +--- + execute_cmd.c | 2 +- + patchlevel.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index 0543cc4..72cdd86 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -3054,7 +3054,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) +diff --git a/patchlevel.h b/patchlevel.h +index 2843303..2e8a3da 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 15 ++#define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.33.0 + diff --git a/bash.spec b/bash.spec index e62afce..95dc282 100644 --- a/bash.spec +++ b/bash.spec @@ -27,12 +27,7 @@ Patch140: bash-5.1-sw.patch Patch6000: backport-fix-for-nofork-comsub-command-printing-fix-for-crash.patch Patch6001: backport-fix-small-memleak-in-globbing.patch Patch6002: backport-fix-for-leak-when-completing-command-word-with-glob-.patch -Patch6003: backport-fix-for-E-transformation-fixes-for-failures-in-arith.patch -Patch6004: backport-changes-for-quoting-special-and-multibyte-characters.patch -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 +Patch6003: 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,8 +156,8 @@ make check %exclude %{_infodir}/dir %changelog -* Fri Apr 26 2024 wangyuhang -5.2.15-8 -- sync patches from bash community +* Tue May 07 2024 xiaozai -5.2.15-8 +- fix for a crash if one of the expressions in an arithmetic for command expands to NULL * Mon Apr 22 2024 wangyuhang -5.2.15-7 - relocations are no longer required. -- Gitee