mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
bus: zero data structure and catch up with error value change
This commit is contained in:
parent
77930f1120
commit
01f6c9d468
@ -475,6 +475,7 @@ int bus_kernel_create(const char *name, char **s) {
|
||||
|
||||
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));
|
||||
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;
|
||||
|
@ -115,7 +115,7 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(r >= 0);
|
||||
|
||||
r = sd_bus_release_name(a, "net.x0pointer.foobar");
|
||||
assert_se(r == -ENXIO);
|
||||
assert_se(r == -ESRCH);
|
||||
|
||||
sd_bus_unref(a);
|
||||
sd_bus_unref(b);
|
||||
|
Loading…
Reference in New Issue
Block a user