fix segfault in delerefilelist

Resolves: rhbz#2245462
This commit is contained in:
Lukáš Zaoral 2024-01-17 14:05:37 +01:00
parent 82b6281e8c
commit 44214321ee
No known key found for this signature in database
GPG Key ID: 39157506DD67752D
3 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,42 @@
From d3edf318306e37d2d96c4e4ea442d10207722e94 Mon Sep 17 00:00:00 2001
From: Bart Schaefer <schaefer@zsh.org>
Date: Sun, 12 Feb 2023 09:52:39 -0800
Subject: [PATCH] 51404: Nullify filelist after deleting (fix segfault)
Cherry-picked-by: Lukáš Zaoral <lzaoral@redhat.com>
Upstream-commit: d3edf318306e37d2d96c4e4ea442d10207722e94
---
Src/jobs.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Src/jobs.c b/Src/jobs.c
index 4863962b9..59ddd952e 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1372,8 +1372,10 @@ cleanfilelists(void)
DPUTS(shell_exiting >= 0, "BUG: cleanfilelists() before exit");
- for (i = 1; i <= maxjob; i++)
+ for (i = 1; i <= maxjob; i++) {
deletefilelist(jobtab[i].filelist, 0);
+ jobtab[i].filelist = 0;
+ }
}
/**/
@@ -1531,8 +1533,10 @@ havefiles(void)
int i;
for (i = 1; i <= maxjob; i++)
- if (jobtab[i].stat && jobtab[i].filelist)
+ if (jobtab[i].stat && jobtab[i].filelist &&
+ peekfirst(jobtab[i].filelist)) {
return 1;
+ }
return 0;
}
--
2.43.0

View File

@ -1,7 +1,7 @@
Summary: Powerful interactive shell
Name: zsh
Version: 5.9
Release: 11%{?dist}
Release: 12%{?dist}
License: MIT-Modern-Variant AND ISC AND GPL-2.0-only
URL: http://zsh.sourceforge.net/
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
@ -25,7 +25,10 @@ Patch4: 0004-zsh-enable-PCRE-locale-switching.patch
Patch5: 0005-zsh-port-to-pcre2.patch
# upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4
Patch6: 0006-zsh-support-texinfo-7.0.patch
Patch7: zsh-configure-c99.patch
# upstream commit 4c89849c98172c951a9def3690e8647dae76308f
Patch7: 0007-zsh-configure-c99.patch
# upstream commit d3edf318306e37d2d96c4e4ea442d10207722e94
Patch8: 0008-zsh-deletefilelist-segfault.patch
BuildRequires: autoconf
BuildRequires: coreutils
@ -171,6 +174,9 @@ fi
%doc Doc/*.html
%changelog
* Wed Jan 17 2024 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-12
- fix segfault in delerefilelist (rhbz#2245462)
* Fri Dec 8 2023 Florian Weimer <fweimer@redhat.com> - 5.9-11
- Fix C compatibility issue in the configure script