summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-14 17:43:59 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-14 17:43:59 +0200
commited5c5dbde1575d74c87ae9856fe61268d7ae8f4b (patch)
treef9cf03c29268df9b37e7f1cfd455752f8ef3ca74 /src/libsystemd-bus/bus-kernel.c
parent01f6c9d4685edbc38c8df9175286f0e312dc1938 (diff)
util: introduce alloca0() and use it at a number of places
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index b2d98c05d7..264c6994d9 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -474,8 +474,7 @@ int bus_kernel_create(const char *name, char **s) {
return -errno;
l = strlen(name);
- make = alloca(offsetof(struct kdbus_cmd_bus_make, name) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1);
- memset(make, 0, offsetof(struct kdbus_cmd_bus_make, name));
+ make = alloca0(offsetof(struct kdbus_cmd_bus_make, name) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1);
sprintf(make->name, "%lu-%s", (unsigned long) getuid(), name);
make->size = offsetof(struct kdbus_cmd_bus_make, name) + strlen(make->name) + 1;
make->flags = KDBUS_ACCESS_WORLD | KDBUS_POLICY_OPEN;