From ce466ee875110bd97daa034dc3a515babc2356e7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 28 Mar 2011 17:20:51 +0100 Subject: [PATCH 09/25] marshal_object: check that it's really an object and its path is valid Again, we can now assume that failure is OOM. --- 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; } -- 1.7.4.1