[Asterisk-code-review] res pjsip pidf eyebeam body supplement: Fix XML generation e... (asterisk[13])

Sean Bright asteriskteam at digium.com
Wed Jul 26 09:02:24 CDT 2017


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/6096


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/96/6096/1

diff --git a/res/res_pjsip_pidf_eyebeam_body_supplement.c b/res/res_pjsip_pidf_eyebeam_body_supplement.c
index 95f0da9..feb6f5e 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/6096
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e5ad450f91106029fb30517b8c0ea0c2058c810
Gerrit-Change-Number: 6096
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/b643e58a/attachment.html>


More information about the asterisk-code-review mailing list