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

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 777feb08f74c22f38036edbe8d9d20f6d8d2f834
Author:	 James Geboski <[email protected]>
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"));
 }
 

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.