]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Check that an iostream exists before accessing.
authorJoshua Colp <jcolp@digium.com>
Thu, 11 Jan 2018 18:05:05 +0000 (13:05 -0500)
committerCorey Farrell <git@cfware.com>
Thu, 11 Jan 2018 18:07:52 +0000 (12:07 -0600)
Before getting the file descriptor for an iostream check
that it is present.

ASTERISK-27534

Change-Id: Ie0aa1394007a37c30e337ea1176a6fb3a63bc99c

channels/chan_sip.c

index 1aa47e2384a9b09c096419a57402e9fce7d3a4a8..487849a09f972241751aa325400c6fadea8f812a 100644 (file)
@@ -29256,7 +29256,7 @@ static int sip_prepare_socket(struct sip_pvt *p)
                return s->fd;
        }
        if ((s->type & (AST_TRANSPORT_TCP | AST_TRANSPORT_TLS)) &&
-                       s->tcptls_session) {
+                       s->tcptls_session && s->tcptls_session->stream) {
                return ast_iostream_get_fd(s->tcptls_session->stream);
        }
        if ((s->type & (AST_TRANSPORT_WS | AST_TRANSPORT_WSS))) {