diff --git a/backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch b/backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c68ab479fa238b883fa5a69f9d157c60e986a2b --- /dev/null +++ b/backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch @@ -0,0 +1,33 @@ +From 1509274359979079e3e61899ce12fc8b0f0958d9 Mon Sep 17 00:00:00 2001 +From: xujing <17826839720@163.com> +Date: Wed, 8 Sep 2021 14:26:20 +0800 +Subject: [PATCH] core: fix free undefined pointer when strdup failed in the + first loop + +--- + src/core/load-fragment.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c +index 92815b1dbaea..1c8159a23550 100644 +--- a/src/core/load-fragment.c ++++ b/src/core/load-fragment.c +@@ -800,7 +800,7 @@ int config_parse_exec( + if (!separate_argv0) { + char *w = NULL; + +- if (!GREEDY_REALLOC(n, nlen + 2)) ++ if (!GREEDY_REALLOC0(n, nlen + 2)) + return log_oom(); + + w = strdup(path); +@@ -832,7 +832,7 @@ int config_parse_exec( + p += 2; + p += strspn(p, WHITESPACE); + +- if (!GREEDY_REALLOC(n, nlen + 2)) ++ if (!GREEDY_REALLOC0(n, nlen + 2)) + return log_oom(); + + w = strdup(";"); + diff --git a/systemd.spec b/systemd.spec index 70eea8d47f6c19f0db8a98c86c1545aa7a2e2d7d..f250eafc078424d943e79fc2e2133f20487a8d73 100644 --- a/systemd.spec +++ b/systemd.spec @@ -20,7 +20,7 @@ Name: systemd Url: https://www.freedesktop.org/wiki/Software/systemd Version: 248 -Release: 12 +Release: 13 License: MIT and LGPLv2+ and GPLv2+ Summary: System and Service Manager @@ -66,7 +66,7 @@ Patch0017: 0017-fix-capsh-drop-but-ping-success.patch Patch0018: 0018-resolved-create-etc-resolv.conf-symlink-at-runtime.patch Patch0019: 0019-journald-enforce-longer-line-length-limit-during-set.patch Patch0020: 0020-fix-CVE-2021-33910.patch - +Patch0021: backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch BuildRequires: gcc, gcc-c++ BuildRequires: libcap-devel, libmount-devel, pam-devel, libselinux-devel @@ -1551,6 +1551,9 @@ fi %exclude /usr/share/man/man3/* %changelog +* Thu Sep 16 2021 ExtinctFire - 248-13 +- core: fix free undefined pointer when strdup failed in the first loop + * Mon Sep 6 2021 yangmingtai - 248-12 - move postun to correct position