]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix minor edge case in switch_split_user_domain
authorTravis Cross <tc@traviscross.com>
Thu, 6 Mar 2014 04:08:45 +0000 (04:08 +0000)
committerTravis Cross <tc@traviscross.com>
Thu, 6 Mar 2014 06:05:16 +0000 (06:05 +0000)
If the input started with 'sip:sips:' it would have been incorrectly
parsed.

src/switch_utils.c

index 346e75416223e2b69d71db978f1c7e4e62acf030..90bea4899ab57ef874bb10f0f79c2469cae821d6 100644 (file)
@@ -3110,7 +3110,7 @@ SWITCH_DECLARE(int) switch_split_user_domain(char *in, char **user, char **domai
 
        /* Remove URL scheme */
        if (!strncasecmp(in, "sip:", 4)) in += 4;
-       if (!strncasecmp(in, "sips:", 5)) in += 5;
+       else if (!strncasecmp(in, "sips:", 5)) in += 5;
 
        /* Isolate the host part from the user part */
        if ((h = in, p = strchr(h, '@'))) *p = '\0', u = in, h = p+1;