tags 631729 + patch
thanks

Hi,

I used “nc -4 -l -p 5222” to simulate a local jabber server, then
started irssi, used /load xmpp and /xmppconnect -h localhost f@b to
trigger the issue.

Attached you can find the patch with which I have come up. Here is the
description:

 Previously, loudmouth would set socket->watch_connect to NULL when
 encountering an error. When the connection attempt (to a different
 IPv6) succeeded later on, _lm_socket_succeeded would therefore not
 remove the socket_connect_cb watcher, leading to socket_connect_cb
 being called upon socket activity and segfaulting the program.

This patch fixes the issue for me, but I don’t use irssi-plugin-xmpp
normally, so testing/review is welcome.

-- 
Best regards,
Michael
Description: fix crash when falling back from IPv6 to IPv4
 Previously, loudmouth would set socket->watch_connect to NULL when
 encountering an error. When the connection attempt (to a different IPv6)
 succeeded later on, _lm_socket_succeeded would therefore not remove the
 socket_connect_cb watcher, leading to socket_connect_cb being called upon
 socket activity and segfaulting the program.
Author: Michael Stapelberg <stapelb...@debian.org>
Bug-Debian: http://bugs.debian.org/631729
Last-Update: 2013-01-28

--- loudmouth-1.4.3.orig/loudmouth/lm-socket.c
+++ loudmouth-1.4.3/loudmouth/lm-socket.c
@@ -529,7 +529,6 @@ socket_connect_cb (GIOChannel   *source,
 			/* error condition, but might be possible to recover
 			 * from it (by connecting to the next host) */
 			if (!_lm_socket_failed_with_error (connect_data, err)) {
-				socket->watch_connect = NULL;
 				goto out;
 			}
 		}
@@ -560,7 +559,6 @@ socket_connect_cb (GIOChannel   *source,
 				_lm_sock_close (connect_data->fd);
 				_lm_socket_failed_with_error (connect_data, err);
 
-				socket->watch_connect = NULL;
 				goto out;
 			}
 		} 

Reply via email to