summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-03-28 17:19:45 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-04-13 14:01:52 +0100
commitf57e4e33838062e98d39764202fdcd60b709362d (patch)
treeddd753e83f234ff5dc1fc1e0a1b7a90e522b7004
parent15bf1a2ef4d8b3e37b056cc893a844706fc714dc (diff)
marshal_proxy: check that it's really a proxy and its path is valid
This means that dbus_message_iter_append_basic can't fail other than by OOM, so use the shared OOM handler. 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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dbus/dbus-gvalue.c b/dbus/dbus-gvalue.c
index f71c233..1748962 100644
--- a/dbus/dbus-gvalue.c
+++ b/dbus/dbus-gvalue.c
@@ -1554,12 +1554,15 @@ marshal_proxy (DBusMessageIter *iter,
g_assert (G_VALUE_TYPE (value) == dbus_g_proxy_get_type ());
proxy = g_value_get_object (value);
+ g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE);
path = dbus_g_proxy_get_path (proxy);
-
+ 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;
}