[Asterisk-code-review] res pjsip pidf eyebeam body supplement: Fix XML generation e... (asterisk[master])
Sean Bright
asteriskteam at digium.com
Wed Jul 26 09:02:48 CDT 2017
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/6099
Change subject: res_pjsip_pidf_eyebeam_body_supplement: Fix XML generation error
......................................................................
res_pjsip_pidf_eyebeam_body_supplement: Fix XML generation error
We are generating a text node <activities> content, when we should be
generating an element node.
ASTERISK~26659
Reported by: Abraham Liebsch
Change-Id: I6e5ad450f91106029fb30517b8c0ea0c2058c810
---
M res/res_pjsip_pidf_eyebeam_body_supplement.c
1 file changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/99/6099/1
diff --git a/res/res_pjsip_pidf_eyebeam_body_supplement.c b/res/res_pjsip_pidf_eyebeam_body_supplement.c
index a0f50fd..46eb59c 100644
--- a/res/res_pjsip_pidf_eyebeam_body_supplement.c
+++ b/res/res_pjsip_pidf_eyebeam_body_supplement.c
@@ -61,10 +61,13 @@
if (pidfstate[0] != '-') {
pj_xml_node *activities = ast_sip_presence_xml_create_node(pool, status, "ep:activities");
size_t str_size = sizeof("ep:") + strlen(pidfstate);
+ char *act_str = ast_alloca(str_size);
- activities->content.ptr = pj_pool_alloc(pool, str_size);
- activities->content.slen = pj_ansi_snprintf(activities->content.ptr, str_size,
- "ep:%s", pidfstate);
+ /* Safe */
+ strcpy(act_str, "ep:");
+ strcat(act_str, pidfstate);
+
+ ast_sip_presence_xml_create_node(pool, activities, act_str);
}
ast_sip_presence_xml_create_attr(pool, node, XMLNS_PP, XMLNS_PERSON);
--
To view, visit https://gerrit.asterisk.org/6099
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e5ad450f91106029fb30517b8c0ea0c2058c810
Gerrit-Change-Number: 6099
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170726/401d7b67/attachment.html>
More information about the asterisk-code-review
mailing list