diff --git a/ksh.spec b/ksh.spec index 44aef1e1aa62f0c373406dc3f6ec6482ee400de1..9470e7eca489b2d431346cd88ac0bfe48a7db76e 100644 --- a/ksh.spec +++ b/ksh.spec @@ -1,6 +1,6 @@ Name: ksh Version: 2020.0.0 -Release: 7 +Release: 8 Summary: The Original ATT Korn Shell License: EPL-1.0 URL: http://www.kornshell.com/ @@ -17,6 +17,8 @@ Patch6002: backport-functions-with-not-loaded-autoloaded-functions.patch Patch6003: backport-Fix-handling-of-skipped-directories.patch Patch6004: backport-Fix-interactive-restricted-shell-behavior.patch +Patch9000: solve-the-problem-of-dereference-null-return-value-w.patch + Provides: /bin/ksh /usr/bin/ksh BuildRequires: meson gcc glibc-devel ed Conflicts: pdksh @@ -89,6 +91,9 @@ done %config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf %changelog +* Tue May 7 2024 wangyuhang - 1:2020.0.0-8 +- solve the problem of dereference null return value when moving a job to the head of the linked list + * Thu Dec 7 2023 wangyuhang - 1:2020.0.0-7 - Type:bugfix - ID:NA diff --git a/solve-the-problem-of-dereference-null-return-value-w.patch b/solve-the-problem-of-dereference-null-return-value-w.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f52837f99254dacc8dc2d897e748c3e20f0c7ef --- /dev/null +++ b/solve-the-problem-of-dereference-null-return-value-w.patch @@ -0,0 +1,32 @@ +From ed22939428be3bd676e4261cf96e144c15d4e686 Mon Sep 17 00:00:00 2001 +From: wangyuhang +Date: Tue, 2 Apr 2024 15:44:35 +0800 +Subject: [PATCH] solve the problem of dereference null return value when + moving a job to the head of the linked list + +--- + src/cmd/ksh93/sh/jobs.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/cmd/ksh93/sh/jobs.c b/src/cmd/ksh93/sh/jobs.c +index 5ad42c0..a46de01 100644 +--- a/src/cmd/ksh93/sh/jobs.c ++++ b/src/cmd/ksh93/sh/jobs.c +@@ -1105,10 +1105,11 @@ int job_post(Shell_t *shp, pid_t pid, pid_t join) { + val = job.curjobid; + } + // If job to join is not first move it to front. +- if (val) { ++ if (val && job.pwlist) { + pw = job_byjid(val); +- assert(pw); +- if (pw != job.pwlist) { ++ if (!pw) ++ errormsg(SH_DICT, ERROR_warn(0), "the job cannot be found in the linked list"); ++ if (pw && (pw != job.pwlist)) { + job_unlink(pw); + pw->p_nxtjob = job.pwlist; + job.pwlist = pw; +-- +2.33.0 +