Diff between d4ed8789c1802ef5404d31d841ead3302580ef93 and cb2169a0abbcc90dc4df3c2d5828af097db88e86

Changed Files

File Additions Deletions Status
gdbus/object.c +6 -1 modified

Full Patch

diff --git a/gdbus/object.c b/gdbus/object.c
index 688cd05..1a54b3f 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -846,6 +846,8 @@ static DBusMessage *properties_set(DBusConnection *connection,
 	const GDBusPropertyTable *property;
 	const char *name, *interface;
 	struct property_data *propdata;
+	gboolean valid_signature;
+	char *signature;
 
 	if (!dbus_message_iter_init(message, &iter))
 		return g_dbus_create_error(message, DBUS_ERROR_INVALID_ARGS,
@@ -896,7 +898,10 @@ 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))
+	signature = dbus_message_iter_get_signature(&sub);
+	valid_signature = strcmp(signature, property->type) ? FALSE : TRUE;
+	dbus_free(signature);
+	if (!valid_signature)
 		return g_dbus_create_error(message,
 					DBUS_ERROR_INVALID_SIGNATURE,
 					"Invalid signature for '%s'", name);