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
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400360
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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);
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);