[asterisk-commits] mnicholson: trunk r220174 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 24 11:33:24 CDT 2009


Author: mnicholson
Date: Thu Sep 24 11:33:20 2009
New Revision: 220174

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=220174
Log:
Ensure the numeric portion of the P-Asserted-Identity header is properly escaped.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=220174&r1=220173&r2=220174
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Sep 24 11:33:20 2009
@@ -9837,6 +9837,7 @@
 static int add_rpid(struct sip_request *req, struct sip_pvt *p)
 {
 	struct ast_str *tmp = ast_str_alloca(256);
+	char tmp2[256];
 	char *lid_num = NULL;
 	char *lid_name = NULL;
 	int lid_pres;
@@ -9860,6 +9861,8 @@
 	if (ast_strlen_zero(lid_name))
 		lid_name = lid_num;
 	fromdomain = S_OR(p->fromdomain, ast_inet_ntoa(p->ourip.sin_addr));
+
+	lid_num = ast_uri_encode(lid_num, tmp2, sizeof(tmp2), 1);
 
 	if (ast_test_flag(&p->flags[0], SIP_SENDRPID_PAI)) {
 		if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {




More information about the asterisk-commits mailing list