diff options
author | dequis <dx@dxzone.com.ar> | 2015-10-08 06:38:15 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-10-08 06:38:15 -0300 |
commit | e1bea35419d0851323fb9d90b6284ded0bae802c (patch) | |
tree | eb467193c7a1be44b3cccfc3178b8d796227a61f | |
parent | c788e1599d6878e447f237d675e7341f5fbc1245 (diff) |
Fix use-after-free when leaving invited (temporary) channels
Trac ticket 1229, https://bugs.bitlbee.org/bitlbee/ticket/1229
This one is complicated. See the trac ticket for details.
Relevant commits: cc20520 6963230 664bac3 - second one fixed the same
issue, third one reverted it, this one takes a different approach.
-rw-r--r-- | irc_im.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -862,8 +862,11 @@ static gboolean bee_irc_channel_chat_part(irc_channel_t *ic, const char *msg) c->ic->acc->prpl->chat_leave(c); } - /* Remove the reference. We don't need it anymore. */ - ic->data = NULL; + if (!(ic->flags & IRC_CHANNEL_TEMP)) { + /* Remove the reference. + * We only need it for temp channels that are being freed */ + ic->data = NULL; + } return TRUE; } |