aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-10-08 06:38:15 -0300
committerdequis <dx@dxzone.com.ar>2015-10-08 06:38:15 -0300
commite1bea35419d0851323fb9d90b6284ded0bae802c (patch)
treeeb467193c7a1be44b3cccfc3178b8d796227a61f
parentc788e1599d6878e447f237d675e7341f5fbc1245 (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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/irc_im.c b/irc_im.c
index 46699747..2d569bbb 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -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;
}