summaryrefslogtreecommitdiff
path: root/include/asterisk/netsock2.h
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-01-19 21:55:41 +0000
committerJonathan Rose <jrose@digium.com>2012-01-19 21:55:41 +0000
commit6fd0ac9dcd8225b060c0038ee0cd5440040a57ef (patch)
treeefd171a8781c38109669281f28b114e399b39cd5 /include/asterisk/netsock2.h
parentddf421bd5c45b94ac31c34c6699f21cf067ab3d1 (diff)
Eliminates doubling the :port part of SIP Notify Message-Account headers.
This patch prevents the domain string from getting mangled during the initreqprep step by moving the initialization to before its immediate use. It also documents this pitfall for the ast_sockaddr_stringify functions. (issue ASTERISK-19057) Reported by: Yuri Review: https://reviewboard.asterisk.org/r/1678/ ........ Merged revisions 351559 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 351560 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/netsock2.h')
-rw-r--r--include/asterisk/netsock2.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asterisk/netsock2.h b/include/asterisk/netsock2.h
index 83af23a97..b541b50eb 100644
--- a/include/asterisk/netsock2.h
+++ b/include/asterisk/netsock2.h
@@ -185,6 +185,14 @@ int ast_sockaddr_cmp_addr(const struct ast_sockaddr *a, const struct ast_sockadd
* a.b.c.d for IPv4
* [a:b:c:...:d] for IPv6.
* AST_SOCKADDR_STR_PORT: port only
+ *
+ * \note The string pointer returned by this function will point to a string that
+ * will be changed whenever any form of ast_sockaddr_stringify_fmt is called on that
+ * thread. Because of this, it is important that if you use this function, you use the
+ * string before another use of this function is made elsewhere in the same thread.
+ * The easiest way to accomplish this is by immediately copying the string to a buffer
+ * with something like ast_strdupa.
+ *
* \retval "(null)" \a addr is null
* \retval "" An error occurred during processing
* \retval string The stringified form of the address