summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-09-05 04:23:04 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-09-05 04:57:38 -0600
commit9cc46203767172eaa713212cfe2fce5cca106577 (patch)
tree9d03407a8fcdc9ca8f99bcc4d5d28363a4bbcee5 /res/res_pjsip_t38.c
parent53458b30eac2e5d676e1fd063224137ee7cd33c4 (diff)
res_pjsip_t38: Make t38_reinvite_response_cb tolerant of NULL channel
t38_reinvite_response_cb can get called by res_pjsip_session's session_inv_on_tsx_state_changed in situations where session->channel is NULL. If it is, the ast_log warning segfaults because it tries to get the channel name from a NULL channel. * Check session->channel and print "unknown channel" when it's NULL. ASTERISK-27236 Reported by: Ross Beer Change-Id: I4326e288d36327f6c79ab52226d54905cdc87dc7
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 27eff424a..ce914a1e8 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -302,9 +302,9 @@ static int t38_reinvite_response_cb(struct ast_sip_session *session, pjsip_rx_da
}
state = t38_state_get_or_alloc(session);
- if (!state) {
+ if (!session->channel || !state) {
ast_log(LOG_WARNING, "Received response to T.38 re-invite on '%s' but state unavailable\n",
- ast_channel_name(session->channel));
+ session->channel ? ast_channel_name(session->channel) : "unknown channel");
return 0;
}