[asterisk-commits] kharwell: branch 1.8 r388838 - /branches/1.8/main/lock.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 15 10:54:52 CDT 2013


Author: kharwell
Date: Wed May 15 10:54:50 2013
New Revision: 388838

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388838
Log:
Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS

If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying
to access a possible NULL t->track object.  A NULL check has been added before
trying to access the memory.

(closes issue ASTERISK-21724)
Reported by: Corey Farrell
Fixed by: Corey Farrell
Patches:
	ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909)

Modified:
    branches/1.8/main/lock.c

Modified: branches/1.8/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/lock.c?view=diff&rev=388838&r1=388837&r2=388838
==============================================================================
--- branches/1.8/main/lock.c (original)
+++ branches/1.8/main/lock.c Wed May 15 10:54:50 2013
@@ -745,7 +745,7 @@
 		__ast_mutex_logger("%s line %d (%s): Error destroying rwlock %s: %s\n",
 				filename, lineno, func, rwlock_name, strerror(res));
 	}
-	if (t->tracking) {
+	if (t->tracking && lt) {
 		ast_reentrancy_lock(lt);
 		lt->file[0] = filename;
 		lt->lineno[0] = lineno;




More information about the asterisk-commits mailing list