fix a coredump issue and a minor memory leak

This commit is contained in:
wangyuhang 2024-12-13 14:49:49 +08:00
parent 72ef711956
commit d862fefc19
3 changed files with 79 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 2610d40b32301cd7256bf1dfc49c9f8bfe0dcd53 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Wed, 28 Aug 2024 11:42:10 -0400
Subject: [PATCH] documentation updates; fix for null commands with redirection
expansion errors; changes to job notifications for interactive shells
sourcing files; fix underflow issue with word_top
Conflict:only the modified content of execute_cmd.c is rounded.
Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=2610d40b32301cd7256bf1dfc49c9f8bfe0dcd53
---
execute_cmd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/execute_cmd.c b/execute_cmd.c
index 71d147c..905adc5 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -4001,7 +4001,7 @@ execute_null_command (redirects, pipe_in, pipe_out, async)
REDIRECT *redirects;
int pipe_in, pipe_out, async;
{
- int r;
+ int r, code;
int forcefork, fork_flags;
REDIRECT *rd;
@@ -4036,6 +4036,10 @@ execute_null_command (redirects, pipe_in, pipe_out, async)
if (pipe_in != NO_PIPE || pipe_out != NO_PIPE)
subshell_environment |= SUBSHELL_PIPE;
+ code = setjmp_nosigs (top_level);
+ if (code)
+ exit (EXECUTION_FAILURE);
+
if (do_redirections (redirects, RX_ACTIVE) == 0)
exit (EXECUTION_SUCCESS);
else
--
2.33.0

View File

@ -0,0 +1,33 @@
From b116cfe57df2c061cd953b77a0fc1b738dd5fe94 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 8 Nov 2024 11:13:57 -0500
Subject: [PATCH] fix for readline redisplay issue in C locale; fix for small
memory leak in termcap replacement library; updates to formatted
documentation; fix problem with distclean and y.tab.h; Makefile clean targets
updates
Conflict:only the modified content of lib/termcap/termcap.c is rounded.
Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=b116cfe57df2c061cd953b77a0fc1b738dd5fe94
---
lib/termcap/termcap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/termcap/termcap.c b/lib/termcap/termcap.c
index ba3dab2..012cd44 100644
--- a/lib/termcap/termcap.c
+++ b/lib/termcap/termcap.c
@@ -533,7 +533,10 @@ tgetent (bp, name)
fd = open (termcap_name, O_RDONLY, 0);
#endif
if (fd < 0)
- return -1;
+ {
+ free (indirect);
+ return -1;
+ }
buf.size = BUFSIZE;
/* Add 1 to size to ensure room for terminating null. */
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: bash
Version: 5.1.8
Release: 16
Release: 17
Summary: It is the Bourne Again Shell
License: GPLv3
URL: https://www.gnu.org/software/bash
@ -46,6 +46,8 @@ Patch6015: backport-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch
Patch6016: backport-renamed-several-functions-beginning-with-legal_-chan.patch
Patch6017: backport-fix-for-cd-when-curent-directory-doesn-t-exist-fix-w.patch
Patch6018: backport-Fix-a-performance-regression-while-using-large-numbe.patch
Patch6019: backport-documentation-updates-fix-for-null-commands-with-red.patch
Patch6020: backport-fix-for-readline-redisplay-issue-in-C-locale-fix-for.patch
BuildRequires: gcc bison texinfo autoconf ncurses-devel
# Required for bash tests
@ -139,6 +141,9 @@ make check
%exclude %{_infodir}/dir
%changelog
* Fri Dec 13 2024 wangyuhang<wangyuhang27@huawei.com> - 5.1.8-17
- fix a coredump issue and a minor memory leak
* Mon Jun 03 2024 Zhao Mengmeng <zhaomengmeng@kylinos.cn> - 5.1.8-16
- Type:bugfix
- CVE:NA