File: chan_sip_hotfix_for_AST-2011-005-p2

package info (click to toggle)
asterisk 1%3A1.6.2.9-2%2Bsqueeze12
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 67,296 kB
  • ctags: 65,026
  • sloc: ansic: 327,660; sh: 11,153; cpp: 5,940; perl: 3,078; makefile: 2,594; yacc: 2,140; asm: 642; xml: 309; sql: 290; tcl: 113; php: 62
file content (17 lines) | stat: -rw-r--r-- 685 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
From: Matthew Nicholson <mnicholson@digium.com>
Date: Mon May 16 15:51:53 2011 UTC 
Bug: https://issues.asterisk.org/view.php?id=19192
Subject: Make sure tcptls_session exists before dereferencing it.
Origin: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=patch&r1=319141&r2=319140&pathrev=319141

--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3213,7 +3213,7 @@
 	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);
 	}