[svn-commits] jrose: trunk r321289 - in /trunk: ./ channels/sip/reqresp_parser.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 27 11:35:53 CDT 2011


Author: jrose
Date: Fri May 27 11:35:49 2011
New Revision: 321289

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321289
Log:
Merged revisions 321273 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r321273 | jrose | 2011-05-27 09:59:34 -0500 (Fri, 27 May 2011) | 3 lines
  
  markm committed a patch I was working on yesterday, this fixes it to mesh up with suggestions by mnicholson.
........

Modified:
    trunk/   (props changed)
    trunk/channels/sip/reqresp_parser.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sip/reqresp_parser.c?view=diff&rev=321289&r1=321288&r2=321289
==============================================================================
--- trunk/channels/sip/reqresp_parser.c (original)
+++ trunk/channels/sip/reqresp_parser.c Fri May 27 11:35:49 2011
@@ -42,25 +42,29 @@
 	char *c = NULL;
 	int error = 0;
 
+	/*
+	 * Initialize requested strings - some functions don't care if parse_uri fails
+	 * and will attempt to use string pointers passed into parse_uri even after a
+	 * parse_uri failure
+	 */
+	if (user) {
+		*user = "";
+	}
+	if (pass) {
+		*pass = "";
+	}
+	if (domain) {
+		*domain = "";
+	}
+	if (headers) {
+		*headers = "";
+	}
+	if (residue) {
+		*residue = "";
+	}
+
 	/* check for valid input */
 	if (ast_strlen_zero(uri)) {
-		/* make sure we leave nothing undefined after we exit */
-		if (user) {
-			*user = "";
-		}
-		if (pass) {
-			*pass = "";
-		}
-		if (domain) {
-			*domain = "";
-		}
-		if (headers) {
-			*headers = "";
-		}
-		if (residue) {
-			*residue = "";
-		}
-
 		return -1;
 	}
 




More information about the svn-commits mailing list