[asterisk-bugs] [Asterisk 0010948]: [patch] Division by zero error when a music on hold class is empty

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 11 11:16:15 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10948 
====================================================================== 
Reported By:                jcomellas
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   10948
Category:                   Resources/res_musiconhold
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.12.1  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             10-11-2007 11:06 CDT
Last Modified:              10-11-2007 11:16 CDT
====================================================================== 
Summary:                    [patch] Division by zero error when a music on hold
class is empty
Description: 
When a music on hold class is empty (chan->music_state->class->total_files
== 0) and Asterisk looks for the next file in the music class by calling
ast_moh_files_next() (on res/res_musiconhold.c) we get a division by zero
signal.

====================================================================== 

---------------------------------------------------------------------- 
 russell - 10-11-07 11:16  
---------------------------------------------------------------------- 
I can't actually see how total_files could ever be 0.  The code for loading
moh classes checks to see if no files were found, and just destroys it if
that is the case.

if (!moh_scan_files(moh)) {
            ast_moh_free_class(&moh);
            return -1;
        } 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-11-07 11:16  russell        Note Added: 0071818                          
======================================================================




More information about the asterisk-bugs mailing list