From 1517b9003334b1602a7dc1e16b7d6fa9e36994da Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 28 Mar 2011 17:20:23 +0100 Subject: [PATCH 08/25] marshal_object_path: check that it's really a valid object path Again, this means failure can only be OOM, so use the shared handler. Also remove an unnecessary cast. --- dbus/dbus-gvalue.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dbus/dbus-gvalue.c b/dbus/dbus-gvalue.c index 1748962..be1fd79 100644 --- a/dbus/dbus-gvalue.c +++ b/dbus/dbus-gvalue.c @@ -1574,12 +1574,14 @@ marshal_object_path (DBusMessageIter *iter, g_assert (G_VALUE_TYPE (value) == DBUS_TYPE_G_OBJECT_PATH); - path = (const char*) g_value_get_boxed (value); - + path = g_value_get_boxed (value); + g_return_val_if_fail (g_variant_is_object_path (path), FALSE); + if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &path)) - return FALSE; + oom (); + return TRUE; } -- 1.7.4.1