mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-01-03 17:10:09 +01:00
libupower-glib: Reject invalid object paths to avoid asserting libdbus
This commit is contained in:
parent
7176815926
commit
ed34986e08
1 changed files with 6 additions and 0 deletions
|
|
@ -286,6 +286,12 @@ up_device_set_object_path_sync (UpDevice *device, const gchar *object_path, GCan
|
|||
if (object_path == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* invalid */
|
||||
if (object_path == NULL || object_path[0] != '/') {
|
||||
g_set_error (error, 1, 0, "Object path %s invalid", object_path);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* connect to the bus */
|
||||
device->priv->bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error_local);
|
||||
if (device->priv->bus == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue