[asterisk-commits] branch bweschke/bug_5374 - r7610 /team/bweschke/bug_5374/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Dec 23 01:18:04 CST 2005


Author: bweschke
Date: Fri Dec 23 01:18:03 2005
New Revision: 7610

URL: http://svn.digium.com/view/asterisk?rev=7610&view=rev
Log:
 Per the suggestion from sokhapkin to prevent a segfault when the function gets called without a valid channel pointer.


Modified:
    team/bweschke/bug_5374/channel.c

Modified: team/bweschke/bug_5374/channel.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/channel.c?rev=7610&r1=7609&r2=7610&view=diff
==============================================================================
--- team/bweschke/bug_5374/channel.c (original)
+++ team/bweschke/bug_5374/channel.c Fri Dec 23 01:18:03 2005
@@ -1775,7 +1775,7 @@
 
 int ast_silence_suppression_enabled(struct ast_channel *chan)
 {
-	int ret = ast_opt_silence_suppression && chan->timingfd > -1;
+	int ret = ast_opt_silence_suppression && chan && chan->timingfd > -1;
 	if (option_verbose > 2)
 		ast_verbose(VERBOSE_PREFIX_3 "Silence suppression is %s (ast_opt_silence_suppression=%d chan->timingfd=%d)\n", ret? "enabled": "disabled", ast_opt_silence_suppression, chan->timingfd);
 	return ret;



More information about the asterisk-commits mailing list