[svn-commits] file: branch 1.2 r120109 - /branches/1.2/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 3 14:30:02 CDT 2008


Author: file
Date: Tue Jun  3 14:30:02 2008
New Revision: 120109

URL: http://svn.digium.com/view/asterisk?view=rev&rev=120109
Log:
Copy the From header into a variable so that pedantic SIP handling does not try to mess with a NULL pointer. (AST-2008-008)
(closes issue #12607)
Reported by: hooi

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=120109&r1=120108&r2=120109
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Tue Jun  3 14:30:02 2008
@@ -6831,12 +6831,14 @@
 			return -1;
 		}
 		from += 4;
+		if (pedanticsipchecking) {
+			ast_uri_decode(from);
+		}
 	} else
 		from = NULL;
 
 	if (pedanticsipchecking) {
 		ast_uri_decode(uri);
-		ast_uri_decode(from);
 	}
 
 	/* Get the target domain first and user */
@@ -7261,11 +7263,10 @@
 	while(*t && (*t > 32) && (*t != ';'))
 		t++;
 	*t = '\0';
-	of = get_header(req, "From");
+
+	ast_copy_string(from, get_header(req, "From"), sizeof(from));
 	if (pedanticsipchecking)
-		ast_uri_decode(of);
-
-	ast_copy_string(from, of, sizeof(from));
+		ast_uri_decode(from);
 	
 	memset(calleridname,0,sizeof(calleridname));
 	get_calleridname(from, calleridname, sizeof(calleridname));




More information about the svn-commits mailing list