]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix extraneous < in sip url parser
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 30 Jul 2014 17:13:57 +0000 (22:13 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 30 Jul 2014 17:13:57 +0000 (22:13 +0500)
src/mod/endpoints/mod_sofia/sofia_glue.c

index ef01bbc0d84009ba34496a6e7972c7873fd87ada..fe522fdd4f0d45f5517d1ea23841c632d0d62b30 100644 (file)
@@ -1495,7 +1495,9 @@ char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup)
                buf++;
        }
 
-       if ((url = strchr(buf, '<')) && (e = switch_find_end_paren(url, '<', '>'))) {
+       url = strchr(buf, '<');
+
+       if (url && (e = switch_find_end_paren(url, '<', '>'))) {
                url++;
                if (to_dup) {
                        url = strdup(url);
@@ -1504,6 +1506,8 @@ char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup)
 
                *e = '\0';
        } else {
+               if (url) buf++;
+
                if (to_dup) {
                        url = strdup(buf);
                } else {