[svn-commits] jrose: branch 1.8 r321273 - /branches/1.8/channels/sip/reqresp_parser.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 27 09:59:39 CDT 2011


Author: jrose
Date: Fri May 27 09:59:34 2011
New Revision: 321273

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321273
Log:
markm committed a patch I was working on yesterday, this fixes it to mesh up with suggestions by mnicholson.


Modified:
    branches/1.8/channels/sip/reqresp_parser.c

Modified: branches/1.8/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sip/reqresp_parser.c?view=diff&rev=321273&r1=321272&r2=321273
==============================================================================
--- branches/1.8/channels/sip/reqresp_parser.c (original)
+++ branches/1.8/channels/sip/reqresp_parser.c Fri May 27 09:59:34 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