dbus: don't call bus_path_escape() with NULL unit name

Fixes an assertion triggerable via D-Bus.

https://bugzilla.redhat.com/show_bug.cgi?id=622008
This commit is contained in:
Lennart Poettering 2010-08-09 17:02:09 +02:00
parent 6d4fc029d9
commit 04ade7d215
2 changed files with 9 additions and 0 deletions

View file

@ -434,6 +434,9 @@ void bus_unit_send_change_signal(Unit *u) {
u->meta.in_dbus_queue = false;
}
if (!u->meta.id)
return;
if (!bus_has_subscriber(u->meta.manager)) {
u->meta.sent_dbus_new_signal = true;
return;
@ -491,6 +494,9 @@ void bus_unit_send_removed_signal(Unit *u) {
if (!u->meta.sent_dbus_new_signal)
bus_unit_send_change_signal(u);
if (!u->meta.id)
return;
if (!(p = unit_dbus_path(u)))
goto oom;

View file

@ -1551,6 +1551,9 @@ char *unit_dbus_path(Unit *u) {
assert(u);
if (!u->meta.id)
return NULL;
if (!(e = bus_path_escape(u->meta.id)))
return NULL;