From: Stefan Becker Date: Wed, 4 Dec 2013 06:50:07 +0000 (+0200) Subject: Fix #222: SIPE crashes when groupchat session expires (V) X-Git-Tag: 1.17.3~5 X-Git-Url: https://repo.or.cz/w/siplcs.git/commitdiff_plain/189db193ee616da96fd8ca2c985fc20b5f8c4745 Fix #222: SIPE crashes when groupchat session expires (V) Another user still sees crashes. I don't have the full debug log, so I can only guess that re-initialization of the groupchat session has failed. Add more sanity checks to groupchat_update_cb(). (cherry picked from commit daa3609c31fdcd2ded14bcab4044cfa23842f743) --- diff --git a/src/core/sipe-groupchat.c b/src/core/sipe-groupchat.c index f90909e5..20e50a63 100644 --- a/src/core/sipe-groupchat.c +++ b/src/core/sipe-groupchat.c @@ -383,19 +383,23 @@ static void groupchat_update_cb(struct sipe_core_private *sipe_private, SIPE_UNUSED_PARAMETER gpointer data) { struct sipe_groupchat *groupchat = sipe_private->groupchat; - struct sip_dialog *dialog = sipe_dialog_find(groupchat->session, - groupchat->session->with); - if (dialog) - sip_transport_update(sipe_private, - dialog, - groupchat_expired_session_response); - sipe_schedule_seconds(sipe_private, - "<+groupchat-expires>", - NULL, - groupchat->expires, - groupchat_update_cb, - NULL); + if (groupchat->session) { + struct sip_dialog *dialog = sipe_dialog_find(groupchat->session, + groupchat->session->with); + + if (dialog) { + sip_transport_update(sipe_private, + dialog, + groupchat_expired_session_response); + sipe_schedule_seconds(sipe_private, + "<+groupchat-expires>", + NULL, + groupchat->expires, + groupchat_update_cb, + NULL); + } + } } static struct sipe_groupchat_msg *chatserver_command(struct sipe_core_private *sipe_private,