diff options
author | Joshua Colp <jcolp@digium.com> | 2013-10-03 14:52:24 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2013-10-03 14:52:24 +0000 |
commit | c977f73e136eca1f2aaccd0ea0fe45c350906374 (patch) | |
tree | 1f036b4061686d5b85a3a1a525e21575cc3b9377 | |
parent | addbf276f5037dc5a265a1e43e383ae1d9e9d0d8 (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
-rw-r--r-- | res/res_pjsip_sdp_rtp.c | 5 | ||||
-rw-r--r-- | res/res_pjsip_t38.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 4b0862114..57c673e0c 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -1097,6 +1097,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); 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); |