diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/cgroup.c | 2 | ||||
-rw-r--r-- | src/core/dbus-execute.c | 2 | ||||
-rw-r--r-- | src/core/dbus-util.c | 2 | ||||
-rw-r--r-- | src/core/execute.c | 10 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 13e69e27b3..931b31e2e1 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -3437,7 +3437,7 @@ Unit* manager_get_unit_by_cgroup(Manager *m, const char *cgroup) { if (u) return u; - p = strdupa(cgroup); + p = strdupa_safe(cgroup); for (;;) { char *e; diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 44f9ee57bd..1c82c7d90d 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -3462,7 +3462,7 @@ int bus_exec_context_set_transient_property( if (soft) { const char *n; - n = strndupa(suffix, soft - suffix); + n = strndupa_safe(suffix, soft - suffix); ri = rlimit_from_string(n); if (ri >= 0) name = strjoina("Limit", n); diff --git a/src/core/dbus-util.c b/src/core/dbus-util.c index f0e75d5bc2..32a2ec0ff9 100644 --- a/src/core/dbus-util.c +++ b/src/core/dbus-util.c @@ -117,7 +117,7 @@ int bus_set_transient_usec_internal( else *p = v; - char *n = strndupa(name, strlen(name) - 4); + char *n = strndupa_safe(name, strlen(name) - 4); unit_write_settingf(u, flags, name, "%sSec=%s", n, FORMAT_TIMESPAN(v, USEC_PER_MSEC)); } diff --git a/src/core/execute.c b/src/core/execute.c index 6397bab315..e1f8d9a31b 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -6524,7 +6524,7 @@ int exec_runtime_deserialize_one(Manager *m, const char *value, FDSet *fds) { assert(fds); n = strcspn(v, " "); - id = strndupa(v, n); + id = strndupa_safe(v, n); if (v[n] != ' ') goto finalize; p = v + n + 1; @@ -6556,7 +6556,7 @@ int exec_runtime_deserialize_one(Manager *m, const char *value, FDSet *fds) { char *buf; n = strcspn(v, " "); - buf = strndupa(v, n); + buf = strndupa_safe(v, n); r = safe_atoi(buf, &netns_fdpair[0]); if (r < 0) @@ -6575,7 +6575,7 @@ int exec_runtime_deserialize_one(Manager *m, const char *value, FDSet *fds) { char *buf; n = strcspn(v, " "); - buf = strndupa(v, n); + buf = strndupa_safe(v, n); r = safe_atoi(buf, &netns_fdpair[1]); if (r < 0) @@ -6594,7 +6594,7 @@ int exec_runtime_deserialize_one(Manager *m, const char *value, FDSet *fds) { char *buf; n = strcspn(v, " "); - buf = strndupa(v, n); + buf = strndupa_safe(v, n); r = safe_atoi(buf, &ipcns_fdpair[0]); if (r < 0) @@ -6613,7 +6613,7 @@ int exec_runtime_deserialize_one(Manager *m, const char *value, FDSet *fds) { char *buf; n = strcspn(v, " "); - buf = strndupa(v, n); + buf = strndupa_safe(v, n); r = safe_atoi(buf, &ipcns_fdpair[1]); if (r < 0) |