[asterisk-commits] file: branch 12 r419750 - /branches/12/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 29 04:53:25 CDT 2014


Author: file
Date: Tue Jul 29 04:50:13 2014
New Revision: 419750

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=419750
Log:
res_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity is unquoted.

The local entity as provided by PJSIP is quoted within '<' and '>'. As a result placing
this value into XML will result in malformed XML being produced. This patch now unquotes
the local entity so it can go safely into the XML.

Review: https://reviewboard.asterisk.org/r/3851/

Modified:
    branches/12/res/res_pjsip_pidf_body_generator.c
    branches/12/res/res_pjsip_xpidf_body_generator.c

Modified: branches/12/res/res_pjsip_pidf_body_generator.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_pidf_body_generator.c?view=diff&rev=419750&r1=419749&r2=419750
==============================================================================
--- branches/12/res/res_pjsip_pidf_body_generator.c (original)
+++ branches/12/res/res_pjsip_pidf_body_generator.c Tue Jul 29 04:50:13 2014
@@ -38,10 +38,11 @@
 static void *pidf_allocate_body(void *data)
 {
 	struct ast_sip_exten_state_data *state_data = data;
+	char *local = ast_strdupa(state_data->local);
 	pjpidf_pres *pres;
 	pj_str_t entity;
 
-	pres = pjpidf_create(state_data->pool, pj_cstr(&entity, state_data->local));
+	pres = pjpidf_create(state_data->pool, pj_cstr(&entity, ast_strip_quoted(local, "<", ">")));
 
 	return pres;
 }

Modified: branches/12/res/res_pjsip_xpidf_body_generator.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_xpidf_body_generator.c?view=diff&rev=419750&r1=419749&r2=419750
==============================================================================
--- branches/12/res/res_pjsip_xpidf_body_generator.c (original)
+++ branches/12/res/res_pjsip_xpidf_body_generator.c Tue Jul 29 04:50:13 2014
@@ -39,10 +39,11 @@
 static void *xpidf_allocate_body(void *data)
 {
 	struct ast_sip_exten_state_data *state_data = data;
+	char *local = ast_strdupa(state_data->local);
 	pjxpidf_pres *pres;
 	pj_str_t name;
 
-	pres = pjxpidf_create(state_data->pool, pj_cstr(&name, state_data->local));
+	pres = pjxpidf_create(state_data->pool, pj_cstr(&name, ast_strip_quoted(local, "<", ">")));
 	return pres;
 }
 




More information about the asterisk-commits mailing list