/soc/2015/jgeboski/facebook: 777feb08f74c: facebook: fixed a dou...

James Geboski jgeboski at gmail.com
Wed Jul 22 18:32:17 EDT 2015


Changeset: 777feb08f74c22f38036edbe8d9d20f6d8d2f834
Author:	 James Geboski <jgeboski at gmail.com>
Date:	 2015-07-22 18:32 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/777feb08f74c

Description:

facebook: fixed a double free with MQTT SSL errors

The error_func for purple_ssl_connect() frees the PurpleSslConnection,
which is forbidden, as the PurpleSslConnection is freed upon hitting an
error.

Thanks to Ethan Blanton for debuggining this and suggesting the fix.

diffstat:

 libpurple/protocols/facebook/mqtt.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff --git a/libpurple/protocols/facebook/mqtt.c b/libpurple/protocols/facebook/mqtt.c
--- a/libpurple/protocols/facebook/mqtt.c
+++ b/libpurple/protocols/facebook/mqtt.c
@@ -550,6 +550,11 @@ fb_mqtt_cb_open_error(PurpleSslConnectio
                       gpointer data)
 {
 	FbMqtt *mqtt = data;
+	FbMqttPrivate *priv = mqtt->priv;
+
+	/* Do not call purple_ssl_close() from the error_func */
+	priv->gsc = NULL;
+
 	fb_mqtt_error(mqtt, FB_MQTT_ERROR_GENERAL, _("Failed to connect"));
 }
 



More information about the Commits mailing list