summary refs log tree commit diff stats
path: root/src/common/dbus
diff options
context:
space:
mode:
authorasarium <asarium@gmail.com>2015-08-02 08:06:21 -0400
committerTingPing <tingping@tingping.se>2015-08-02 08:06:21 -0400
commit422cce6f70c55a7b70b028f227834b58b37b980b (patch)
tree2245c50252d88c84a3b19ad4a5693af7d5ecc1bc /src/common/dbus
parentafd2135393c4c4f759054bbadfce7accbef4e927 (diff)
Fix crash in DBus plugin
Closes #1438
Diffstat (limited to 'src/common/dbus')
-rw-r--r--src/common/dbus/dbus-plugin.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/dbus/dbus-plugin.c b/src/common/dbus/dbus-plugin.c
index bb9fb5e1..1afd9ef0 100644
--- a/src/common/dbus/dbus-plugin.c
+++ b/src/common/dbus/dbus-plugin.c
@@ -366,6 +366,7 @@ remote_object_connect (RemoteObject *obj,
 	static guint count = 0;
 	char *sender, *path;
 	RemoteObject *remote_object;
+	gchar count_buffer[15];
 	
 	sender = dbus_g_method_get_sender (context);
 	remote_object = g_hash_table_lookup (clients, sender);
@@ -374,7 +375,8 @@ remote_object_connect (RemoteObject *obj,
 		g_free (sender);
 		return TRUE;
 	}
-	path = g_build_filename (DBUS_OBJECT_PATH, count++, NULL);
+	g_snprintf(count_buffer, sizeof(count_buffer), "%u", count++);
+	path = g_build_filename (DBUS_OBJECT_PATH, count_buffer, NULL);
 	remote_object = g_object_new (REMOTE_TYPE_OBJECT, NULL);
 	remote_object->dbus_path = path;
 	remote_object->filename = g_path_get_basename (filename);