cpw.darkrain42.xmpp.scram: f1af8fe2: jabber: Ugh, make this C89-compliant. Ba...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Dec 4 00:10:57 EST 2009


-----------------------------------------------------------------
Revision: f1af8fe229e16f1aa75efa63193aa7e166d25ed9
Ancestor: 50f14751848ac6dc0120aaf24e9a2defb21850f0
Author: darkrain42 at pidgin.im
Date: 2009-12-04T05:07:26
Branch: im.pidgin.cpw.darkrain42.xmpp.scram
URL: http://d.pidgin.im/viewmtn/revision/info/f1af8fe229e16f1aa75efa63193aa7e166d25ed9

Modified files:
        libpurple/protocols/jabber/auth_scram.c

ChangeLog: 

jabber: Ugh, make this C89-compliant. Bah.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth_scram.c	403db21f131a6114fab65b6d0cf9b96cfc883ae3
+++ libpurple/protocols/jabber/auth_scram.c	0d682b79576e16f3d9b40622a61bc01ea258a015
@@ -140,11 +140,13 @@ jabber_scram_calc_proofs(JabberScramData
 	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;
 	data->server_signature = g_string_sized_new(hash_len);
@@ -176,6 +178,11 @@ jabber_scram_calc_proofs(JabberScramData
 	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;
 }
 


More information about the Commits mailing list