[asterisk-bugs] [JIRA] (ASTERISK-20854) app_minivm core dump in ast_str_encode_mime

Matt Jordan (JIRA) noreply at issues.asterisk.org
Tue Jan 15 08:57:45 CST 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=201504#comment-201504 ] 

Matt Jordan commented on ASTERISK-20854:
----------------------------------------

Comparing this to {{ast_str_encode_mime}} in {{app_voicemail}}, your analysis is correct.

The fact that we have two implementations of this method - where one of them is wrong and causes a crash - is no good. This should probably be a public function in strings.h.
                
> app_minivm core dump in ast_str_encode_mime
> -------------------------------------------
>
>                 Key: ASTERISK-20854
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20854
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_minivm
>    Affects Versions: 10.9.0
>         Environment: Centos 6.3
>            Reporter: Chris Warr
>
> ast_str_encode is called from sendmail if an address contains any characters that need mime-encoding.  In my case the user name was "Laura (Reception)".
> It looks like when the ast_str_encode_mime function was converted to use the ast_str structure someone didn't remove a string initialisation.  The bug occurs from *end = '\0' clearing out the structure and later it's set which core dumps.
> 	struct ast_str *tmp = ast_str_alloca(80);
> 	int first_section = 1;
> 	*end = '\0';                  <-- This should be deleted
> 	ast_str_reset(*end);
> ...
> ...
>    // Will core dump a functions down through here
>    ast_str_append(end, maxlen, "%s%s?=%s", first_section ? "" : " ", ast_str_buffer(tmp), ast_str_strlen(tmp) + postamble > 74 ? " " : "");
> This bug is still in the 11 branch, however I am using 10.9.
> I've removed this line, recompiled at tested successfully.
> Regards,
> Chris.

--
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