]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure tcptls_session exists before dereferencing it.
authorMatthew Nicholson <mnicholson@digium.com>
Mon, 16 May 2011 15:51:53 +0000 (15:51 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Mon, 16 May 2011 15:51:53 +0000 (15:51 +0000)
(closes issue #19192)
Reported by: stknob
Patches:
      10-tcptls-unreachable-peer-segfault.patch uploaded by Chainsaw (license 723)
Tested by: vois, Chainsaw

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@319141 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 85957187ccfd8232bb8d2eaeecffef1036f9aa20..f2cfcf04d6f4ff04f434fcd5ce61e23420843559 100644 (file)
@@ -3213,7 +3213,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
        ast_debug(2, "Shutting down thread for %s server\n", tcptls_session->ssl ? "SSL" : "TCP");
 
 cleanup:
-       if (!tcptls_session->client && !authenticated) {
+       if (tcptls_session && !tcptls_session->client && !authenticated) {
                ast_atomic_fetchadd_int(&unauth_sessions, -1);
        }