From: <fac...@us...> - 2006-12-04 12:52:31
|
Revision: 17894 http://svn.sourceforge.net/gaim/?rev=17894&view=rev Author: faceprint Date: 2006-12-04 04:52:18 -0800 (Mon, 04 Dec 2006) Log Message: ----------- hopefully fix the jabber crash people are seeing, and plug a small memory leak Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-12-04 11:36:31 UTC (rev 17893) +++ trunk/libgaim/protocols/jabber/auth.c 2006-12-04 12:52:18 UTC (rev 17894) @@ -716,6 +716,7 @@ js->sasl_state = sasl_client_step(js->sasl, (char*)dec_in, declen, NULL, &c_out, &clen); + g_free(enc_in); g_free(dec_in); if (js->sasl_state != SASL_CONTINUE && js->sasl_state != SASL_OK) { gaim_debug_error("jabber", "Error is %d : %s\n",js->sasl_state,sasl_errdetail(js->sasl)); @@ -753,9 +754,20 @@ * should try one more round against it */ if (js->sasl_state != SASL_OK) { + char *enc_in = xmlnode_get_data(packet); + unsigned char *dec_in = NULL; const char *c_out; unsigned int clen; - js->sasl_state = sasl_client_step(js->sasl, NULL, 0, NULL, &c_out, &clen); + gsize declen = 0; + + if(enc_in != NULL) + dec_in = gaim_base64_decode(enc_in, &declen); + + js->sasl_state = sasl_client_step(js->sasl, (char*)dec_in, declen, NULL, &c_out, &clen); + + g_free(enc_in); + g_free(dec_in); + if (js->sasl_state != SASL_OK) { /* This should never happen! */ gaim_connection_error(js->gc, _("Invalid response from server.")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |