[asterisk-bugs] [JIRA] Created: (ASTERISK-20138) Use of ast_asprintf and asprintf needs to be checked for failure.

Rusty Newton (JIRA) noreply at issues.asterisk.org
Mon Jul 16 16:11:20 CDT 2012


Use of ast_asprintf and asprintf needs to be checked for failure.
-----------------------------------------------------------------

                 Key: ASTERISK-20138
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20138
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: General
            Reporter: Richard Mudgett


The ast_asprintf() call does not always set the returned buffer pointer to NULL when allocation fails.  This should be fixed because it is useful to assume that the buffer pointer will be NULL on failure.

The use of asprintf() needs to be converted to ast_asprintf() so it can be paired with ast_free() correctly.  Not all places where asprintf() is called can free the allocated buffer by free() because the buffer is passed to a function or put onto a structure that needs to use ast_free().

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list