mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
Fix method for creating activities string in PIDF bodies.
The previous method did not allocate enough space to create the entire string, but adjusted the string's slen value to be larger than the actual allocation. This resulted in garbled text in NOTIFY requests from Asterisk. This method allocates the proper amount of space first and then writes the content into the buffer. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -159,8 +159,11 @@ static void add_non_standard(pj_pool_t *pool, pj_xml_node *node, const char *pid
|
|||||||
|
|
||||||
if (pidfstate[0] != '-') {
|
if (pidfstate[0] != '-') {
|
||||||
pj_xml_node *activities = create_node(pool, status, "ep:activities");
|
pj_xml_node *activities = create_node(pool, status, "ep:activities");
|
||||||
pj_strdup2(pool, &activities->content, "ep:");
|
size_t str_size = sizeof("ep:") + strlen(pidfstate);
|
||||||
pj_strcat2(&activities->content, pidfstate);
|
|
||||||
|
activities->content.ptr = pj_pool_alloc(pool, str_size);
|
||||||
|
activities->content.slen = pj_ansi_snprintf(activities->content.ptr, str_size,
|
||||||
|
"ep:%s", pidfstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
create_attr(pool, node, XMLNS_PP, XMLNS_PERSON);
|
create_attr(pool, node, XMLNS_PP, XMLNS_PERSON);
|
||||||
|
|||||||
Reference in New Issue
Block a user