[asterisk-commits] [svn-commits] branch mogorman/asterisk-xmpp r17738 - /team/mogorman/asterisk-xmpp/res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 5 22:22:48 MST 2006


Author: markster
Date: Thu Apr  6 00:22:46 2006
New Revision: 17738

URL: http://svn.digium.com/view/asterisk?rev=17738&view=rev
Log:
Actually allocate memory for base64 encode...

Modified:
    team/mogorman/asterisk-xmpp/res/res_xmpp.c

Modified: team/mogorman/asterisk-xmpp/res/res_xmpp.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/res_xmpp.c?rev=17738&r1=17737&r2=17738&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/res_xmpp.c (original)
+++ team/mogorman/asterisk-xmpp/res/res_xmpp.c Thu Apr  6 00:22:46 2006
@@ -372,11 +372,12 @@
 								x = iks_new ("auth");
 								iks_insert_attrib (x, "xmlns", IKS_NS_XMPP_SASL);
 								int len = strlen (client->jid->user) + strlen (client->password) + 3;
+								/* XXX Check return values XXX */
 								char *s = ast_malloc (80+len);
-								char *base64;
+								char *base64 = ast_malloc(80 + len * 2);
 								iks_insert_attrib (x, "mechanism", "PLAIN");
 								sprintf (s, "%c%s%c%s", 0, client->jid->user, 0, client->password);
-								ast_base64encode(base64, s,len,((len/3+1)*4 +1));
+								ast_base64encode(base64, s,len, len * 2);
 
 								iks_insert_cdata (x, base64, 0);
 								iks_send (client->p, x);

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


More information about the asterisk-commits mailing list