pidgin: 4bc08b46: jabber: Use a 129 byte buffer to fit the...

malu at pidgin.im malu at pidgin.im
Mon Mar 22 18:25:41 EDT 2010


-----------------------------------------------------------------
Revision: 4bc08b46766e0e90fc3cffefe00104882456b92f
Ancestor: d2cd6030fc66f726f61a1d7576facd0ef6ea5fe5
Author: malu at pidgin.im
Date: 2010-03-22T22:23:35
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/4bc08b46766e0e90fc3cffefe00104882456b92f

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

ChangeLog: 

jabber: Use a 129 byte buffer to fit the hex output of SHA-512 (including \0)
(I believe purple_cipher_digest_to_str should check the input length).
Maybe we should add way for ciphers to report the digest length...

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jutil.c	ee53e0980059e268db730508474687cf46e48519
+++ libpurple/protocols/jabber/jutil.c	e235b25d5f555565bc0dc271b36aa49633e86337
@@ -733,7 +733,7 @@ jabber_calculate_data_hash(gconstpointer
     const gchar *hash_algo)
 {
 	PurpleCipherContext *context;
-	static gchar digest[41];
+	static gchar digest[129]; /* 512 bits hex + \0 */
 
 	context = purple_cipher_context_new_by_name(hash_algo, NULL);
 	if (context == NULL)


More information about the Commits mailing list