From 49700ecf0fd05ff5302f503918d3ed86cbea7649 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 30 Jul 2014 22:13:57 +0500 Subject: [PATCH] fix extraneous < in sip url parser --- src/mod/endpoints/mod_sofia/sofia_glue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index ef01bbc0d8..fe522fdd4f 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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 {