summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-10-03 14:52:24 +0000
committerJoshua Colp <jcolp@digium.com>2013-10-03 14:52:24 +0000
commitc977f73e136eca1f2aaccd0ea0fe45c350906374 (patch)
tree1f036b4061686d5b85a3a1a525e21575cc3b9377 /res/res_pjsip_t38.c
parentaddbf276f5037dc5a265a1e43e383ae1d9e9d0d8 (diff)
Fix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and external_media_address is set.
The callback function for changing the media address in streams wrongly assumes that a connection line will always be present. This is false as no line is present if a stream has been rejected. (closes issue ASTERISK-22645) Reported by: Rusty Newton ........ Merged revisions 400360 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 285e9015e..e44820214 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -776,6 +776,11 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
char host[NI_MAXHOST];
struct ast_sockaddr addr = { { 0, } };
+ /* If the stream has been rejected there will be no connection line */
+ if (!stream->conn) {
+ return;
+ }
+
ast_copy_pj_str(host, &stream->conn->addr, sizeof(host));
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);