[asterisk-commits] file: branch 12 r400872 - /branches/12/res/res_pjsip_session.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 13 10:41:40 CDT 2013


Author: file
Date: Sun Oct 13 10:41:37 2013
New Revision: 400872

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400872
Log:
Fix a race condition in res_pjsip_session with rapidly terminating the session.

The INVITE session state callback wrongly assumes that a session will always exist, but
when rapidly terminating the session this assumption goes out the window. As all handler
code for the INVITE session state callback requires the session it will now just exit
immediately if no session exists.

(closes issue ASTERISK-22668)
Reported by: John Bigelow

Modified:
    branches/12/res/res_pjsip_session.c

Modified: branches/12/res/res_pjsip_session.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_session.c?view=diff&rev=400872&r1=400871&r2=400872
==============================================================================
--- branches/12/res/res_pjsip_session.c (original)
+++ branches/12/res/res_pjsip_session.c Sun Oct 13 10:41:37 2013
@@ -1813,6 +1813,10 @@
 	struct ast_sip_session *session = inv->mod_data[session_module.id];
 
 	print_debug_details(inv, NULL, e);
+
+	if (!session) {
+		return;
+	}
 
 	switch(e->type) {
 	case PJSIP_EVENT_TX_MSG:




More information about the asterisk-commits mailing list