From 323d8d6911b3c4b68d833cea42f2caa9f60345be Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 22 Dec 2022 16:22:35 +0900 Subject: [PATCH] feat: Add pipeline null check logic Change-Id: I2fd33d92ef112290448d08aabd0ed7ec29ab9fbf --- packaging/add_pipeline_null_check.patch | 13 +++++++++++++ packaging/bash.spec | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 packaging/add_pipeline_null_check.patch diff --git a/packaging/add_pipeline_null_check.patch b/packaging/add_pipeline_null_check.patch new file mode 100644 index 0000000..398d728 --- /dev/null +++ b/packaging/add_pipeline_null_check.patch @@ -0,0 +1,13 @@ +diff --git a/jobs.c b/jobs.c +index d183394..b6f951f 100644 +--- a/jobs.c ++++ b/jobs.c +@@ -1275,6 +1275,8 @@ find_pipeline (pid, alive_only, jobp) + p = the_pipeline; + do + { ++ if ( p == 0x00 ) break; ++ + /* Return it if we found it. Don't ever return a recycled pid. */ + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + return (p); diff --git a/packaging/bash.spec b/packaging/bash.spec index 60863b5..e823f04 100644 --- a/packaging/bash.spec +++ b/packaging/bash.spec @@ -13,6 +13,7 @@ Url: http://www.gnu.org/software/bash Group: Base/Utilities Source0: %{name}-%{version}.tar.gz Source1001: bash.manifest +Source1002: add_pipeline_null_check.patch BuildRequires: autoconf BuildRequires: bison BuildRequires: fdupes @@ -29,6 +30,7 @@ incorporates useful features from the Korn shell (ksh) and the C shell %prep %setup -q cp %{SOURCE1001} . +%{__patch} -p1 < %{SOURCE1002} %build export CFLAGS+=" -fPIC -fvisibility=hidden -flto " -- 2.34.1