From: Marcel Holtmann Date: Sat, 5 Jan 2013 04:28:07 +0000 (-0800) Subject: gdbus: Check signature of property value before calling setter X-Git-Tag: android-x86-4.4-r3~9051 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5c7bb42c0850b8feef07ed9f91482d76b7b5e100;p=android-x86%2Fexternal-bluetooth-bluez.git gdbus: Check signature of property value before calling setter --- diff --git a/gdbus/object.c b/gdbus/object.c index e569acb95..688cd0592 100644 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -896,6 +896,11 @@ static DBusMessage *properties_set(DBusConnection *connection, DBUS_ERROR_UNKNOWN_PROPERTY, "No such property '%s'", name); + if (strcmp(dbus_message_iter_get_signature(&sub), property->type)) + return g_dbus_create_error(message, + DBUS_ERROR_INVALID_SIGNATURE, + "Invalid signature for '%s'", name); + propdata = g_new(struct property_data, 1); propdata->id = next_pending_property++; propdata->message = dbus_message_ref(message);