Fix some potential misuses of ast_str in the code.
authorMark Michelson <mmichelson@digium.com>
Mon, 15 Oct 2012 21:25:29 +0000 (21:25 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 15 Oct 2012 21:25:29 +0000 (21:25 +0000)
commite9ab568f88b48c1129c79fa2f008b5be72399bc6
treef10049c3dc1174a601f224397b8ed6b04c9f6bab
parente41a591dfc6c199602d2a49ef9a139ec1ad054a7
Fix some potential misuses of ast_str in the code.

Passing an ast_str pointer by value that then calls
ast_str_set(), ast_str_set_va(), ast_str_append(), or
ast_str_append_va() can result in the pointer originally
passed by value being invalidated if the ast_str had
to be reallocated.

This fixes places in the code that do this. Only the
example in ccss.c could result in pointer invalidation
though since the other cases use a stack-allocated ast_str
and cannot be reallocated.

I've also updated the doxygen in strings.h to include
notes about potential misuse of the functions mentioned
previously.

Review: https://reviewboard.asterisk.org/r/2161
........

Merged revisions 375025 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375026 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375027 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_dial.c
channels/chan_iax2.c
include/asterisk/strings.h
main/ccss.c