From 5299226f5bd91c9ea185ebda5be78d4e1e1a6685 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Wed, 10 Sep 2025 08:57:06 +0800 Subject: [PATCH] fix a double free error (cherry picked from commit 77d4f0d99f7d7e9e8963ddbc568f024624fc4b27) --- ...e-error-when-there-are-three-empty-d.patch | 29 +++++++++++++++++++ chkconfig.spec | 6 +++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 backport-fix-a-double-free-error-when-there-are-three-empty-d.patch diff --git a/backport-fix-a-double-free-error-when-there-are-three-empty-d.patch b/backport-fix-a-double-free-error-when-there-are-three-empty-d.patch new file mode 100644 index 0000000..87a9731 --- /dev/null +++ b/backport-fix-a-double-free-error-when-there-are-three-empty-d.patch @@ -0,0 +1,29 @@ +From d07b2f010ff40f7980c602016ee2fcdedf921653 Mon Sep 17 00:00:00 2001 +From: wangyuhang <524413304@qq.com> +Date: Mon, 25 Aug 2025 19:31:53 +0800 +Subject: [PATCH] fix a double free error when there are three empty + description fields in the xinetd configuration + +--- + leveldb.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/leveldb.c b/leveldb.c +index 7450e75..eb8ee79 100644 +--- a/leveldb.c ++++ b/leveldb.c +@@ -267,8 +267,10 @@ int readXinetdServiceInfo(char *name, struct service *service) { + buf += 11; + if (readDescription(buf, start + sb.st_size, &serv.desc, + &eng_desc)) { +- if (serv.desc) ++ if (serv.desc) { + free(serv.desc); ++ serv.desc = NULL; ++ } + } + if (!serv.desc) { + if (eng_desc) +-- +2.43.0 + diff --git a/chkconfig.spec b/chkconfig.spec index 96ae3b0..67346cd 100644 --- a/chkconfig.spec +++ b/chkconfig.spec @@ -1,7 +1,7 @@ Summary: A system tool for maintaining the /etc/rc*.d hierarchy Name: chkconfig Version: 1.21 -Release: 2 +Release: 3 License: GPLv2 URL: https://github.com/fedora-sysv/chkconfig Source: https://github.com/fedora-sysv/chkconfig/archive/refs/tags/%{name}-%{version}.tar.gz @@ -14,6 +14,7 @@ Provides: /sbin/chkconfig Patch0: fix-coredump-while-parseServiceInfo-return-1.patch Patch6000: backport-leveldb-fix-systemdActive.patch +Patch6001: backport-fix-a-double-free-error-when-there-are-three-empty-d.patch %description Chkconfig is a basic system utility. It updates and queries runlevel @@ -59,6 +60,9 @@ mkdir -p $RPM_BUILD_ROOT/etc/chkconfig.d %{_mandir}/man8/* %changelog +* Wed Sep 10 2025 yixiangzhike - 1.21-3 +- fix a double free error + * Mon Aug 12 2024 fuanan - 1.21-2 - fix systemdActive() -- Gitee