mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
dbus-common: fix segfault when a DBus message has no interface
dbus_message_get_interface() may return NULL. https://bugzilla.redhat.com/show_bug.cgi?id=707483
This commit is contained in:
parent
d636fa3d67
commit
cda2b84a69
@ -418,9 +418,13 @@ DBusHandlerResult bus_default_message_handler(
|
||||
return bus_send_error_reply(c, message, &error, -EINVAL);
|
||||
}
|
||||
|
||||
} else if (!nulstr_contains(interfaces, dbus_message_get_interface(message))) {
|
||||
dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface");
|
||||
return bus_send_error_reply(c, message, &error, -EINVAL);
|
||||
} else {
|
||||
const char *interface = dbus_message_get_interface(message);
|
||||
|
||||
if (!interface || !nulstr_contains(interfaces, interface)) {
|
||||
dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface");
|
||||
return bus_send_error_reply(c, message, &error, -EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
if (reply) {
|
||||
|
Loading…
Reference in New Issue
Block a user