[asterisk-bugs] [JIRA] (ASTERISK-19756) Use of asprintf with MALLOC_DEBUG could corrupt memory or crash.

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Thu Sep 12 20:31:04 CDT 2013


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

Richard Mudgett commented on ASTERISK-19756:
--------------------------------------------

This needs to be reevaluated to see if it is still true.  A change was made that addressed this by creating an ast_asprintf() function that is safe for MALLOC_DEBUG.  There is also ast_std_free() which would need to be used with asprintf() to ensure correct freeing.
                
> Use of asprintf with MALLOC_DEBUG could corrupt memory or crash.
> ----------------------------------------------------------------
>
>                 Key: ASTERISK-19756
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-19756
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: General
>    Affects Versions: SVN
>            Reporter: Richard Mudgett
>
> Use of asprintf() allocates a block of memory to hold the output string.  When Asterisk is compiled with the MALLOC_DEBUG option, ast_free() is no longer the same as free().  Memory allocated with malloc() must be freed with free().  Memory allocated with ast_malloc() must be freed with ast_free().
> Most of the places where asprintf() is called free the resulting buffer with ast_free() a few lines later.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list