[asterisk-bugs] [JIRA] (ASTERISK-19451) va_start/va_copy and va_end do not always match up
Matt Jordan (JIRA)
noreply at issues.asterisk.org
Thu Mar 28 11:38:09 CDT 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-19451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Jordan updated ASTERISK-19451:
-----------------------------------
Target Release Version/s: 11.4.0
> va_start/va_copy and va_end do not always match up
> --------------------------------------------------
>
> Key: ASTERISK-19451
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-19451
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: General
> Affects Versions: SVN
> Reporter: Walter Doekes
> Assignee: Walter Doekes
> Severity: Minor
> Target Release: 1.8.22.0, 11.4.0
>
> Attachments: ASTERISK-19451-1.8--2.diff, ASTERISK-19451-1.8.diff
>
>
> {noformat}
> va_end()
> Each invocation of va_start() must be matched by a corresponding invo‐
> cation of va_end() in the same function. After the call va_end(ap)
> the variable ap is undefined. Multiple traversals of the list, each
> bracketed by va_start() and va_end() are possible. va_end() may be a
> macro or a function.
> {noformat}
> and
> {quote}[...] on systems where arguments are passed in registers, it may be necessary for va_start() to allocate memory, store the arguments there, and also an indication of which argument is next, so that va_arg() can step through the list. Now va_end() can free the allocated memory again.{quote}
> This is not always done right:
> - there is a va_end too many in main/utils.c
> - there are a couple too few in res/res_config_odbc.c and then lots of va_copy's aren't closed on early failure-return
> - res/res_config_pgsql.c and res/res_config_curl.c have lots of va_ends but does not start/copy any (they shouldn't va_end, the callers of ast_load_realtime_helper handle both va_start/va_end)
> And possibly a few more.
--
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