diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-03-28 17:20:51 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-04-13 14:02:00 +0100 |
commit | 98e5da6a6363b68042503e8e01819dc86ec7781e (patch) | |
tree | 3c609273faca76072534ad05d756e074f12ead58 | |
parent | 5d90b996ad4e9ee927d25fc692c8b08baa2a36b4 (diff) |
marshal_object: check that it's really an object and its path is valid
Again, we can now assume that failure is OOM.
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171
-rw-r--r-- | dbus/dbus-gvalue.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dbus/dbus-gvalue.c b/dbus/dbus-gvalue.c index be1fd79..db84472 100644 --- a/dbus/dbus-gvalue.c +++ b/dbus/dbus-gvalue.c @@ -1593,16 +1593,16 @@ marshal_object (DBusMessageIter *iter, GObject *obj; obj = g_value_get_object (value); + g_return_val_if_fail (G_IS_OBJECT (obj), FALSE); + path = _dbus_gobject_get_path (obj); + g_return_val_if_fail (g_variant_is_object_path (path), FALSE); - if (path == NULL) - /* FIXME should throw error */ - return FALSE; - if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &path)) - return FALSE; + oom (); + return TRUE; } |