[asterisk-bugs] [JIRA] (ASTERISK-18986) Segmentation fault when cdr_mysql.conf file contains errors

Matt Jordan (JIRA) noreply at issues.asterisk.org
Sun Jan 20 21:44:21 CST 2013


     [ https://issues.asterisk.org/jira/browse/ASTERISK-18986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Jordan closed ASTERISK-18986.
----------------------------------

    Resolution: Fixed
    
> Segmentation fault when cdr_mysql.conf file contains errors
> -----------------------------------------------------------
>
>                 Key: ASTERISK-18986
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-18986
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Addons/cdr_mysql
>    Affects Versions: 1.8.7.1
>            Reporter: Andrzej Marchlewski
>         Attachments: backtrace.txt, bugfix-diff
>
>
> When I was configuring my asterisk I accidentally made a mistake in cdr_mysql.conf. After saving file and reloading configuration asterisk started crashing immediately after start.
> Here is bit of my cdr_mysql.conf causing crash:
> ;[global]                                                                                                                       hostname=localhost
> dbname=asteriskcdr
> table=cdr 
> After I debuged this problem I found out that a config was failing to load because of parameters existing without section (section [global] get commented out).
> Here is my solution for this problem:
> ===================================================================
> --- cdr_mysql.c	(revision 347489)
> +++ cdr_mysql.c	(working copy)
> @@ -448,9 +448,14 @@
>  	if (!cfg) {
>  		ast_log(LOG_WARNING, "Unable to load config for mysql CDR's: %s\n", config);
>  		return AST_MODULE_LOAD_SUCCESS;
> -	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
> +	} else if (cfg == CONFIG_STATUS_FILEUNCHANGED){
>  		return AST_MODULE_LOAD_SUCCESS;
> +	}else if (cfg == CONFIG_STATUS_FILEINVALID) {
> +	    ast_log(LOG_ERROR, "Config file %s is in an invalid format.  Aborting.\n", config);
> +		return AST_MODULE_LOAD_DECLINE;
> +	}
>  
> +	
>  	if (reload) {
>  		AST_RWLIST_WRLOCK(&columns);
>  		my_unload_module(1);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list