diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-04-05 16:21:12 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-08-17 19:19:14 +0100 |
commit | 30198a2368c9cd19db4b8f595bfad7a719ada7e9 (patch) | |
tree | b32303db1cd13809df423b56ce7c8b12d01fd428 | |
parent | a2a3315ac9747dcc7dda860ceb1d1f94ab56d29b (diff) |
get_all_object_properties: skip invalidly-named properties, with a critical
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
-rw-r--r-- | 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 93656f8..e4775b4 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1289,6 +1289,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); |