From f419685517d932e930c2d0268cdecf885baad3e9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 5 Apr 2011 16:21:12 +0100 Subject: [PATCH 12/15] get_all_object_properties: skip invalidly-named properties, with a critical --- dbus/dbus-gobject.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index 305db08..5516b60 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1266,6 +1266,15 @@ get_all_object_properties (DBusConnection *connection, p = property_iterate (p, object_info->format_version, &prop_ifname, &prop_name, &prop_uscored, &access_flags); + /* Conventionally, property names are valid member names, but dbus-glib + * doesn't enforce this, and some dbus-glib services use GObject-style + * property names (e.g. "foo-bar"). */ + if (!g_utf8_validate (prop_name, -1, NULL)) + { + g_critical ("property name isn't UTF-8: %s", prop_name); + continue; + } + uscore_propname = lookup_property_name (object, wincaps_propiface, prop_name); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), uscore_propname); -- 1.7.4.1