From: Matthew Nicholson Date: Mon, 16 May 2011 15:53:26 +0000 (+0000) Subject: Make sure tcptls_session exists before dereferencing it. X-Git-Tag: 1.8.5-rc1~11^2~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f625f139af52c0d4e215dafd0d271093df425b2;p=thirdparty%2Fasterisk.git Make sure tcptls_session exists before dereferencing it. (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.8@319142 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f350b9799b..63d4a6964f 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2740,7 +2740,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); }