mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
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
This commit is contained in:
@@ -1097,6 +1097,11 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
|
|||||||
char host[NI_MAXHOST];
|
char host[NI_MAXHOST];
|
||||||
struct ast_sockaddr addr = { { 0, } };
|
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_copy_pj_str(host, &stream->conn->addr, sizeof(host));
|
||||||
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
|
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
|
||||||
|
|
||||||
|
@@ -776,6 +776,11 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
|
|||||||
char host[NI_MAXHOST];
|
char host[NI_MAXHOST];
|
||||||
struct ast_sockaddr addr = { { 0, } };
|
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_copy_pj_str(host, &stream->conn->addr, sizeof(host));
|
||||||
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
|
ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user