gdbus: Check signature of property value before calling setter

This commit is contained in:
Marcel Holtmann 2013-01-04 20:28:07 -08:00
parent a39520e1be
commit 3143ea126e
1 changed files with 5 additions and 0 deletions

View File

@ -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);