summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2019-08-30 20:06:21 -0400
committerMike Gilbert <floppym@gentoo.org>2019-08-30 20:06:21 -0400
commit13753ecee96cc81b190ac36776c8dedb2056d4b9 (patch)
tree45819e27f05ce200644ca59677a1b1633def891f
parentsys-apps/tcp-wrappers: fix USE=-ipv6 (diff)
downloadgentoo-13753ece.tar.gz
gentoo-13753ece.tar.bz2
gentoo-13753ece.zip
sys-apps/systemd: remove obsolete patches
Package-Manager: Portage-2.3.73_p4, Repoman-2.3.17_p24 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--sys-apps/systemd/files/243-rc1-analyze.patch125
-rw-r--r--sys-apps/systemd/files/243-rc1-cryptsetup.patch148
-rw-r--r--sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch31
-rw-r--r--sys-apps/systemd/files/243-rc1-udev-properties.patch53
-rw-r--r--sys-apps/systemd/files/CVE-2019-6454/0001-Refuse-dbus-message-paths-longer-than-BUS_PATH_SIZE_.patch48
-rw-r--r--sys-apps/systemd/files/CVE-2019-6454/0002-Allocate-temporary-strings-to-hold-dbus-paths-on-the.patch188
6 files changed, 0 insertions, 593 deletions
diff --git a/sys-apps/systemd/files/243-rc1-analyze.patch b/sys-apps/systemd/files/243-rc1-analyze.patch
deleted file mode 100644
index e38b51eb1210..000000000000
--- a/sys-apps/systemd/files/243-rc1-analyze.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 417b82e1c341946d277383471f2972b7227061ff Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Tue, 30 Jul 2019 14:51:38 -0400
-Subject: [PATCH] analyze: declare dump_exit_status outside of HAVE_SECCOMP
- block
-
-Fixes: 76ed04d936f757763c32db5dbaaebd8b13785d7b
-Closes: https://github.com/systemd/systemd/issues/13230
----
- src/analyze/analyze.c | 92 +++++++++++++++++++++----------------------
- 1 file changed, 46 insertions(+), 46 deletions(-)
-
-diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
-index f62879371d..4d81026084 100644
---- a/src/analyze/analyze.c
-+++ b/src/analyze/analyze.c
-@@ -1608,6 +1608,52 @@ static int dump_unit_paths(int argc, char *argv[], void *userdata) {
- return 0;
- }
-
-+static int dump_exit_status(int argc, char *argv[], void *userdata) {
-+ _cleanup_(table_unrefp) Table *table = NULL;
-+ int r;
-+
-+ table = table_new("name", "status", "class");
-+ if (!table)
-+ return log_oom();
-+
-+ r = table_set_align_percent(table, table_get_cell(table, 0, 1), 100);
-+ if (r < 0)
-+ return log_error_errno(r, "Failed to right-align status: %m");
-+
-+ if (strv_isempty(strv_skip(argv, 1)))
-+ for (size_t i = 0; i < ELEMENTSOF(exit_status_mappings); i++) {
-+ if (!exit_status_mappings[i].name)
-+ continue;
-+
-+ r = table_add_many(table,
-+ TABLE_STRING, exit_status_mappings[i].name,
-+ TABLE_INT, (int) i,
-+ TABLE_STRING, exit_status_class(i));
-+ if (r < 0)
-+ return r;
-+ }
-+ else
-+ for (int i = 1; i < argc; i++) {
-+ int status;
-+
-+ status = exit_status_from_string(argv[i]);
-+ if (status < 0)
-+ return log_error_errno(r, "Invalid exit status \"%s\": %m", argv[i]);
-+
-+ assert(status >= 0 && (size_t) status < ELEMENTSOF(exit_status_mappings));
-+ r = table_add_many(table,
-+ TABLE_STRING, exit_status_mappings[status].name ?: "-",
-+ TABLE_INT, status,
-+ TABLE_STRING, exit_status_class(status) ?: "-");
-+ if (r < 0)
-+ return r;
-+ }
-+
-+ (void) pager_open(arg_pager_flags);
-+
-+ return table_print(table, NULL);
-+}
-+
- #if HAVE_SECCOMP
-
- static int load_kernel_syscalls(Set **ret) {
-@@ -1685,52 +1731,6 @@ static void dump_syscall_filter(const SyscallFilterSet *set) {
- printf(" %s%s%s\n", syscall[0] == '@' ? ansi_underline() : "", syscall, ansi_normal());
- }
-
--static int dump_exit_status(int argc, char *argv[], void *userdata) {
-- _cleanup_(table_unrefp) Table *table = NULL;
-- int r;
--
-- table = table_new("name", "status", "class");
-- if (!table)
-- return log_oom();
--
-- r = table_set_align_percent(table, table_get_cell(table, 0, 1), 100);
-- if (r < 0)
-- return log_error_errno(r, "Failed to right-align status: %m");
--
-- if (strv_isempty(strv_skip(argv, 1)))
-- for (size_t i = 0; i < ELEMENTSOF(exit_status_mappings); i++) {
-- if (!exit_status_mappings[i].name)
-- continue;
--
-- r = table_add_many(table,
-- TABLE_STRING, exit_status_mappings[i].name,
-- TABLE_INT, (int) i,
-- TABLE_STRING, exit_status_class(i));
-- if (r < 0)
-- return r;
-- }
-- else
-- for (int i = 1; i < argc; i++) {
-- int status;
--
-- status = exit_status_from_string(argv[i]);
-- if (status < 0)
-- return log_error_errno(r, "Invalid exit status \"%s\": %m", argv[i]);
--
-- assert(status >= 0 && (size_t) status < ELEMENTSOF(exit_status_mappings));
-- r = table_add_many(table,
-- TABLE_STRING, exit_status_mappings[status].name ?: "-",
-- TABLE_INT, status,
-- TABLE_STRING, exit_status_class(status) ?: "-");
-- if (r < 0)
-- return r;
-- }
--
-- (void) pager_open(arg_pager_flags);
--
-- return table_print(table, NULL);
--}
--
- static int dump_syscall_filters(int argc, char *argv[], void *userdata) {
- bool first = true;
-
---
-2.22.0
-
diff --git a/sys-apps/systemd/files/243-rc1-cryptsetup.patch b/sys-apps/systemd/files/243-rc1-cryptsetup.patch
deleted file mode 100644
index e922d4d29cbd..000000000000
--- a/sys-apps/systemd/files/243-rc1-cryptsetup.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-From f4ea8432e67110b73b07dd0e47a5339d83b350fb Mon Sep 17 00:00:00 2001
-From: Lennart Poettering <lennart@poettering.net>
-Date: Wed, 31 Jul 2019 09:38:15 +0200
-Subject: [PATCH] cryptsetup-generator: fix coverity issue
-
-Fixes coverity issue 1403772
----
- src/cryptsetup/cryptsetup-generator.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
-index c51bb9ae189..960f4762b7d 100644
---- a/src/cryptsetup/cryptsetup-generator.c
-+++ b/src/cryptsetup/cryptsetup-generator.c
-@@ -46,30 +46,30 @@ STATIC_DESTRUCTOR_REGISTER(arg_disks, hashmap_freep);
- STATIC_DESTRUCTOR_REGISTER(arg_default_options, freep);
- STATIC_DESTRUCTOR_REGISTER(arg_default_keyfile, freep);
-
--static int split_keyspec(const char *keyspec, char **keyfile, char **keydev) {
-+static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_keydev) {
- _cleanup_free_ char *kfile = NULL, *kdev = NULL;
-- char *c;
-+ const char *c;
-
- assert(keyspec);
-- assert(keyfile);
-- assert(keydev);
-+ assert(ret_keyfile);
-+ assert(ret_keydev);
-
- c = strrchr(keyspec, ':');
- if (c) {
- kfile = strndup(keyspec, c-keyspec);
- kdev = strdup(c + 1);
-- if (!*kfile || !*kdev)
-+ if (!kfile || !kdev)
- return log_oom();
- } else {
- /* No keydev specified */
- kfile = strdup(keyspec);
- kdev = NULL;
-- if (!*kfile)
-+ if (!kfile)
- return log_oom();
- }
-
-- *keyfile = TAKE_PTR(kfile);
-- *keydev = TAKE_PTR(kdev);
-+ *ret_keyfile = TAKE_PTR(kfile);
-+ *ret_keydev = TAKE_PTR(kdev);
-
- return 0;
- }
-From 5d2100dc4c32abbce4109e75cbfbbef6e1b2b7b1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 1 Aug 2019 08:13:13 +0200
-Subject: [PATCH] cryptsetup: use unabbrieviated variable names
-
-Now that "ret_" has been added to the output variables, we can name
-the internal variables without artificial abbrevs.
----
- src/cryptsetup/cryptsetup-generator.c | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
-index 960f4762b7d..84483143945 100644
---- a/src/cryptsetup/cryptsetup-generator.c
-+++ b/src/cryptsetup/cryptsetup-generator.c
-@@ -47,7 +47,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_default_options, freep);
- STATIC_DESTRUCTOR_REGISTER(arg_default_keyfile, freep);
-
- static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_keydev) {
-- _cleanup_free_ char *kfile = NULL, *kdev = NULL;
-+ _cleanup_free_ char *keyfile = NULL, *keydev = NULL;
- const char *c;
-
- assert(keyspec);
-@@ -56,20 +56,20 @@ static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_key
-
- c = strrchr(keyspec, ':');
- if (c) {
-- kfile = strndup(keyspec, c-keyspec);
-- kdev = strdup(c + 1);
-- if (!kfile || !kdev)
-+ keyfile = strndup(keyspec, c-keyspec);
-+ keydev = strdup(c + 1);
-+ if (!keyfile || !keydev)
- return log_oom();
- } else {
- /* No keydev specified */
-- kfile = strdup(keyspec);
-- kdev = NULL;
-- if (!kfile)
-+ keyfile = strdup(keyspec);
-+ keydev = NULL;
-+ if (!keyfile)
- return log_oom();
- }
-
-- *ret_keyfile = TAKE_PTR(kfile);
-- *ret_keydev = TAKE_PTR(kdev);
-+ *ret_keyfile = TAKE_PTR(keyfile);
-+ *ret_keydev = TAKE_PTR(keydev);
-
- return 0;
- }
-From fef716b28be6e866b8afe995805d5ebe2af6bbfa Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
-Date: Thu, 1 Aug 2019 08:15:43 +0200
-Subject: [PATCH] cryptsetup: don't assert on variable which is optional
-
-https://github.com/systemd/systemd/commit/50d2eba27b9bfc77ef6b40e5721713846815418b#commitcomment-34519739
-
-In add_crypttab_devices() split_keyspec is called on the keyfile argument,
-which may be NULL.
----
- src/cryptsetup/cryptsetup-generator.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
-index 84483143945..4815ded753f 100644
---- a/src/cryptsetup/cryptsetup-generator.c
-+++ b/src/cryptsetup/cryptsetup-generator.c
-@@ -50,10 +50,14 @@ static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_key
- _cleanup_free_ char *keyfile = NULL, *keydev = NULL;
- const char *c;
-
-- assert(keyspec);
- assert(ret_keyfile);
- assert(ret_keydev);
-
-+ if (!keyspec) {
-+ *ret_keyfile = *ret_keydev = NULL;
-+ return 0;
-+ }
-+
- c = strrchr(keyspec, ':');
- if (c) {
- keyfile = strndup(keyspec, c-keyspec);
-@@ -567,7 +571,7 @@ static int add_crypttab_devices(void) {
- }
-
- for (;;) {
-- _cleanup_free_ char *line = NULL, *name = NULL, *device = NULL, *keydev = NULL, *keyfile = NULL, *keyspec = NULL, *options = NULL;
-+ _cleanup_free_ char *line = NULL, *name = NULL, *device = NULL, *keyspec = NULL, *options = NULL, *keyfile = NULL, *keydev = NULL;
- crypto_device *d = NULL;
- char *l, *uuid;
- int k;
diff --git a/sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch b/sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch
deleted file mode 100644
index 30a20c17661d..000000000000
--- a/sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 18f689b1fa35c53580da62bfce875fb15d20d448 Mon Sep 17 00:00:00 2001
-From: Yu Watanabe <watanabe.yu+github@gmail.com>
-Date: Sun, 4 Aug 2019 05:43:34 +0900
-Subject: [PATCH] Revert "logind: remove unused check"
-
-This reverts commit f2330acda408a34451d5e15380fcdd225a672473.
-
-Fixes #13255.
----
- src/login/logind-action.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/src/login/logind-action.c b/src/login/logind-action.c
-index fa92f4870a2..140953eec10 100644
---- a/src/login/logind-action.c
-+++ b/src/login/logind-action.c
-@@ -61,8 +61,12 @@ int manager_handle_action(
- int r;
-
- assert(m);
-- /* We should be called only with valid actions different than HANDLE_IGNORE. */
-- assert(handle > HANDLE_IGNORE && handle < _HANDLE_ACTION_MAX);
-+
-+ /* If the key handling is turned off, don't do anything */
-+ if (handle == HANDLE_IGNORE) {
-+ log_debug("Refusing operation, as it is turned off.");
-+ return 0;
-+ }
-
- if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) {
- /* If the last system suspend or startup is too close,
diff --git a/sys-apps/systemd/files/243-rc1-udev-properties.patch b/sys-apps/systemd/files/243-rc1-udev-properties.patch
deleted file mode 100644
index 5e2ffa1868a3..000000000000
--- a/sys-apps/systemd/files/243-rc1-udev-properties.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 41c81c4a626fda0969fc09ddeb8addb7aae6e4d9 Mon Sep 17 00:00:00 2001
-From: Yu Watanabe <watanabe.yu+github@gmail.com>
-Date: Sun, 4 Aug 2019 06:08:06 +0900
-Subject: [PATCH] udev: do not try to import properties on commented out lines
-
-Fixes #13257.
----
- src/udev/udev-rules.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
-index 3473a7eb7e5..1642f105354 100644
---- a/src/udev/udev-rules.c
-+++ b/src/udev/udev-rules.c
-@@ -1401,8 +1401,10 @@ static int get_property_from_string(char *line, char **ret_key, char **ret_value
- key = skip_leading_chars(line, NULL);
-
- /* comment or empty line */
-- if (IN_SET(key[0], '#', '\0'))
-+ if (IN_SET(key[0], '#', '\0')) {
-+ *ret_key = *ret_value = NULL;
- return 0;
-+ }
-
- /* split key/value */
- val = strchr(key, '=');
-@@ -1429,7 +1431,7 @@ static int get_property_from_string(char *line, char **ret_key, char **ret_value
-
- *ret_key = key;
- *ret_value = val;
-- return 0;
-+ return 1;
- }
-
- static int import_parent_into_properties(sd_device *dev, const char *filter) {
-@@ -1681,6 +1683,8 @@ static int udev_rule_apply_token_to_event(
- line);
- continue;
- }
-+ if (r == 0)
-+ continue;
-
- r = device_add_property(dev, key, value);
- if (r < 0)
-@@ -1719,6 +1723,8 @@ static int udev_rule_apply_token_to_event(
- line);
- continue;
- }
-+ if (r == 0)
-+ continue;
-
- r = device_add_property(dev, key, value);
- if (r < 0)
diff --git a/sys-apps/systemd/files/CVE-2019-6454/0001-Refuse-dbus-message-paths-longer-than-BUS_PATH_SIZE_.patch b/sys-apps/systemd/files/CVE-2019-6454/0001-Refuse-dbus-message-paths-longer-than-BUS_PATH_SIZE_.patch
deleted file mode 100644
index 6a0c8d1b0c51..000000000000
--- a/sys-apps/systemd/files/CVE-2019-6454/0001-Refuse-dbus-message-paths-longer-than-BUS_PATH_SIZE_.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 29de632674473729d1e9497b6fe47e7c88682ed9 Mon Sep 17 00:00:00 2001
-From: Riccardo Schirone <rschiron@redhat.com>
-Date: Mon, 4 Feb 2019 14:29:09 +0100
-Subject: [PATCH 1/3] Refuse dbus message paths longer than BUS_PATH_SIZE_MAX
- limit.
-
-Even though the dbus specification does not enforce any length limit on the
-path of a dbus message, having to analyze too long strings in PID1 may be
-time-consuming and it may have security impacts.
-
-In any case, the limit is set so high that real-life applications should not
-have a problem with it.
----
- src/libsystemd/sd-bus/bus-internal.c | 2 +-
- src/libsystemd/sd-bus/bus-internal.h | 4 ++++
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/src/libsystemd/sd-bus/bus-internal.c b/src/libsystemd/sd-bus/bus-internal.c
-index 40acae2133..598b7f110c 100644
---- a/src/libsystemd/sd-bus/bus-internal.c
-+++ b/src/libsystemd/sd-bus/bus-internal.c
-@@ -43,7 +43,7 @@ bool object_path_is_valid(const char *p) {
- if (slash)
- return false;
-
-- return true;
-+ return (q - p) <= BUS_PATH_SIZE_MAX;
- }
-
- char* object_path_startswith(const char *a, const char *b) {
-diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
-index f208b294d8..a8d61bf72a 100644
---- a/src/libsystemd/sd-bus/bus-internal.h
-+++ b/src/libsystemd/sd-bus/bus-internal.h
-@@ -332,6 +332,10 @@ struct sd_bus {
-
- #define BUS_MESSAGE_SIZE_MAX (128*1024*1024)
- #define BUS_AUTH_SIZE_MAX (64*1024)
-+/* Note that the D-Bus specification states that bus paths shall have no size limit. We enforce here one
-+ * anyway, since truly unbounded strings are a security problem. The limit we pick is relatively large however,
-+ * to not clash unnecessarily with real-life applications. */
-+#define BUS_PATH_SIZE_MAX (64*1024)
-
- #define BUS_CONTAINER_DEPTH 128
-
---
-2.20.1
-
diff --git a/sys-apps/systemd/files/CVE-2019-6454/0002-Allocate-temporary-strings-to-hold-dbus-paths-on-the.patch b/sys-apps/systemd/files/CVE-2019-6454/0002-Allocate-temporary-strings-to-hold-dbus-paths-on-the.patch
deleted file mode 100644
index bbc6db974d4a..000000000000
--- a/sys-apps/systemd/files/CVE-2019-6454/0002-Allocate-temporary-strings-to-hold-dbus-paths-on-the.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-From 1ffe59592c5cbf924eb81a3662b4252ba6de7132 Mon Sep 17 00:00:00 2001
-From: Riccardo Schirone <rschiron@redhat.com>
-Date: Mon, 4 Feb 2019 14:29:28 +0100
-Subject: [PATCH 2/3] Allocate temporary strings to hold dbus paths on the heap
-
-Paths are limited to BUS_PATH_SIZE_MAX but the maximum size is anyway too big
-to be allocated on the stack, so let's switch to the heap where there is a
-clear way to understand if the allocation fails.
----
- src/libsystemd/sd-bus/bus-objects.c | 68 +++++++++++++++++++++++------
- 1 file changed, 54 insertions(+), 14 deletions(-)
-
-diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
-index 58329f3fe7..54b977418e 100644
---- a/src/libsystemd/sd-bus/bus-objects.c
-+++ b/src/libsystemd/sd-bus/bus-objects.c
-@@ -1133,7 +1133,8 @@ static int object_manager_serialize_path_and_fallbacks(
- const char *path,
- sd_bus_error *error) {
-
-- char *prefix;
-+ _cleanup_free_ char *prefix = NULL;
-+ size_t pl;
- int r;
-
- assert(bus);
-@@ -1149,7 +1150,12 @@ static int object_manager_serialize_path_and_fallbacks(
- return 0;
-
- /* Second, add fallback vtables registered for any of the prefixes */
-- prefix = newa(char, strlen(path) + 1);
-+ pl = strlen(path);
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-+
- OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
- r = object_manager_serialize_path(bus, reply, prefix, path, true, error);
- if (r < 0)
-@@ -1345,6 +1351,7 @@ static int object_find_and_run(
- }
-
- int bus_process_object(sd_bus *bus, sd_bus_message *m) {
-+ _cleanup_free_ char *prefix = NULL;
- int r;
- size_t pl;
- bool found_object = false;
-@@ -1369,9 +1376,12 @@ int bus_process_object(sd_bus *bus, sd_bus_message *m) {
- assert(m->member);
-
- pl = strlen(m->path);
-- do {
-- char prefix[pl+1];
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-
-+ do {
- bus->nodes_modified = false;
-
- r = object_find_and_run(bus, m, m->path, false, &found_object);
-@@ -1498,9 +1508,15 @@ static int bus_find_parent_object_manager(sd_bus *bus, struct node **out, const
-
- n = hashmap_get(bus->nodes, path);
- if (!n) {
-- char *prefix;
-+ _cleanup_free_ char *prefix = NULL;
-+ size_t pl;
-+
-+ pl = strlen(path);
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-
-- prefix = newa(char, strlen(path) + 1);
- OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
- n = hashmap_get(bus->nodes, prefix);
- if (n)
-@@ -2083,8 +2099,9 @@ _public_ int sd_bus_emit_properties_changed_strv(
- const char *interface,
- char **names) {
-
-+ _cleanup_free_ char *prefix = NULL;
- bool found_interface = false;
-- char *prefix;
-+ size_t pl;
- int r;
-
- assert_return(bus, -EINVAL);
-@@ -2105,6 +2122,12 @@ _public_ int sd_bus_emit_properties_changed_strv(
-
- BUS_DONT_DESTROY(bus);
-
-+ pl = strlen(path);
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-+
- do {
- bus->nodes_modified = false;
-
-@@ -2114,7 +2137,6 @@ _public_ int sd_bus_emit_properties_changed_strv(
- if (bus->nodes_modified)
- continue;
-
-- prefix = newa(char, strlen(path) + 1);
- OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
- r = emit_properties_changed_on_interface(bus, prefix, path, interface, true, &found_interface, names);
- if (r != 0)
-@@ -2246,7 +2268,8 @@ static int object_added_append_all_prefix(
-
- static int object_added_append_all(sd_bus *bus, sd_bus_message *m, const char *path) {
- _cleanup_set_free_ Set *s = NULL;
-- char *prefix;
-+ _cleanup_free_ char *prefix = NULL;
-+ size_t pl;
- int r;
-
- assert(bus);
-@@ -2291,7 +2314,12 @@ static int object_added_append_all(sd_bus *bus, sd_bus_message *m, const char *p
- if (bus->nodes_modified)
- return 0;
-
-- prefix = newa(char, strlen(path) + 1);
-+ pl = strlen(path);
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-+
- OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
- r = object_added_append_all_prefix(bus, m, s, prefix, path, true);
- if (r < 0)
-@@ -2430,7 +2458,8 @@ static int object_removed_append_all_prefix(
-
- static int object_removed_append_all(sd_bus *bus, sd_bus_message *m, const char *path) {
- _cleanup_set_free_ Set *s = NULL;
-- char *prefix;
-+ _cleanup_free_ char *prefix = NULL;
-+ size_t pl;
- int r;
-
- assert(bus);
-@@ -2462,7 +2491,12 @@ static int object_removed_append_all(sd_bus *bus, sd_bus_message *m, const char
- if (bus->nodes_modified)
- return 0;
-
-- prefix = newa(char, strlen(path) + 1);
-+ pl = strlen(path);
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-+
- OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
- r = object_removed_append_all_prefix(bus, m, s, prefix, path, true);
- if (r < 0)
-@@ -2612,7 +2646,8 @@ static int interfaces_added_append_one(
- const char *path,
- const char *interface) {
-
-- char *prefix;
-+ _cleanup_free_ char *prefix = NULL;
-+ size_t pl;
- int r;
-
- assert(bus);
-@@ -2626,7 +2661,12 @@ static int interfaces_added_append_one(
- if (bus->nodes_modified)
- return 0;
-
-- prefix = newa(char, strlen(path) + 1);
-+ pl = strlen(path);
-+ assert(pl <= BUS_PATH_SIZE_MAX);
-+ prefix = new(char, pl + 1);
-+ if (!prefix)
-+ return -ENOMEM;
-+
- OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
- r = interfaces_added_append_one_prefix(bus, m, prefix, path, interface, true);
- if (r != 0)
---
-2.20.1
-