nspawn: don't use strjoina() for user controlled strings

This commit is contained in:
Lennart Poettering
2025-06-12 17:37:45 +02:00
parent a13fda9e67
commit 93555abe29

View File

@@ -266,7 +266,7 @@ int allocate_scope(
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *w = NULL;
_cleanup_free_ char *scope = NULL;
const char *description, *object;
const char *object;
int r;
assert(bus);
@@ -292,12 +292,14 @@ int allocate_scope(
if (r < 0)
return bus_log_create_error(r);
description = strjoina("Container ", machine_name);
r = bus_append_scope_pidref(m, pid, FLAGS_SET(flags, ALLOCATE_SCOPE_ALLOW_PIDFD));
if (r < 0)
return bus_log_create_error(r);
_cleanup_free_ char *description = strjoin("Container ", machine_name);
if (!description)
return log_oom();
r = sd_bus_message_append(m, "(sv)(sv)(sv)(sv)(sv)",
"Description", "s", description,
"Delegate", "b", 1,