[Asterisk-code-review] res_pjsip_pubsub: XML sanitized RLS display name (asterisk[19])

Alexei Gradinari asteriskteam at digium.com
Tue Jun 7 18:00:51 CDT 2022


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18640 )


Change subject: res_pjsip_pubsub: XML sanitized RLS display name
......................................................................

res_pjsip_pubsub: XML sanitized RLS display name

ASTERISK-29891

Change-Id: Ic8c9697e616446e06e6302653eae902aa23372ad
---
M res/res_pjsip_pubsub.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/40/18640/1

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 5cccdcc..a0fe273 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -2070,6 +2070,7 @@
 	pj_xml_attr *cid_attr;
 	char id[6];
 	char uri[PJSIP_MAX_URL_SIZE];
+	char name_sanitized[PJSIP_MAX_URL_SIZE];
 
 	/* This creates a string representing the Content-ID without the enclosing < > */
 	const pj_str_t cid_stripped = {
@@ -2084,7 +2085,8 @@
 	pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, resource_uri, uri, sizeof(uri));
 	ast_sip_presence_xml_create_attr(pool, resource, "uri", uri);
 
-	pj_strdup2(pool, &name->content, resource_name);
+	ast_sip_sanitize_xml(resource_name, name_sanitized, sizeof(name_sanitized));
+	pj_strdup2(pool, &name->content, name_sanitized);
 
 	ast_generate_random_string(id, sizeof(id));
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18640
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: Ic8c9697e616446e06e6302653eae902aa23372ad
Gerrit-Change-Number: 18640
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220607/801db2d2/attachment.html>


More information about the asterisk-code-review mailing list