changeset 28752:a6cd1db77aee

jabber: Ugh, make this C89-compliant. Bah.
author Paul Aurich <paul@darkrain42.org>
date Fri, 04 Dec 2009 05:07:26 +0000
parents 5af6304fde5d
children 8a5252630857
files libpurple/protocols/jabber/auth_scram.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth_scram.c	Thu Dec 03 17:00:54 2009 +0000
+++ b/libpurple/protocols/jabber/auth_scram.c	Fri Dec 04 05:07:26 2009 +0000
@@ -140,10 +140,12 @@
 	GString *pass = g_string_new(data->password);
 
 	guchar *salted_password;
-	guchar client_key[hash_len];
-	guchar stored_key[hash_len];
-	guchar client_signature[hash_len];
-	guchar server_key[hash_len];
+	guchar *client_key, *stored_key, *client_signature, *server_key;
+
+	client_key = g_new0(guchar, hash_len);
+	stored_key = g_new0(guchar, hash_len);
+	client_signature = g_new0(guchar, hash_len);
+	server_key = g_new0(guchar, hash_len);
 
 	data->client_proof = g_string_sized_new(hash_len);
 	data->client_proof->len = hash_len;
@@ -176,6 +178,11 @@
 	for (i = 0; i < hash_len; ++i)
 		data->client_proof->str[i] = client_key[i] ^ client_signature[i];
 
+	g_free(server_key);
+	g_free(client_signature);
+	g_free(stored_key);
+	g_free(client_key);
+
 	return TRUE;
 }