[asterisk-bugs] [Asterisk 0016993]: [patch] MusicOnHold produces a crash

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Jun 5 08:00:54 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16993 
====================================================================== 
Reported By:                dmitri
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   16993
Category:                   Resources/res_musiconhold
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
JIRA:                       SWP-1062 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 251399 
Request Review:              
====================================================================== 
Date Submitted:             2010-03-09 02:29 CST
Last Modified:              2010-06-05 08:00 CDT
====================================================================== 
Summary:                    [patch] MusicOnHold produces a crash
Description: 
MusicOnHold produces a crash on hangup when class configured in realtime
refers for non existing or an empty directory.
And this only happens when using cachertclasses flag in musiconhold.conf.
I made a patch for fixing this issue.
====================================================================== 

---------------------------------------------------------------------- 
 (0123002) dmitri (reporter) - 2010-06-05 08:00
 https://issues.asterisk.org/view.php?id=16993#c123002 
---------------------------------------------------------------------- 
Let me explain the logic of this.

If we are cashing realtime classes, then we call moh_register function,
which adds class to memory container after some validity checks like a
filesystem checks etc. If it fails, then we can not find this class by
get_mohbyname function, but passed argument (mohclass) is not NULL now.

If we are not using cache, then mohclass be checked in subjected function
local_ast_moh_start (lines 1347-1404), and will be set to NULL if fails.

I said earlier that Your code will work in second case, it's not true.
Just because we are not using cache, thus we cannot find this class in
memory -- this is always be empty.

And I thought it would be cool to avoid unnecessary call of ast_test_flag.
So new patch is ready. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-05 08:00 dmitri         Note Added: 0123002                          
======================================================================




More information about the asterisk-bugs mailing list