[Freeswitch-trunk] [commit] r13781 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia
FreeSWITCH SVN
mikej at freeswitch.org
Tue Jun 16 06:41:02 PDT 2009
Author: mikej
Date: Tue Jun 16 08:41:01 2009
New Revision: 13781
Log:
fix seg in some edge cases
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/switch_utils.c
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Tue Jun 16 08:41:01 2009
@@ -1662,7 +1662,7 @@
sofia_glue_tech_patch_sdp(tech_pvt);
}
- if (tech_pvt->dest && (route = strstr(tech_pvt->dest, ";fs_path="))) {
+ if (tech_pvt->dest && (route = strstr(tech_pvt->dest, ";fs_path=")) && (*(route + 9))) {
char *p;
route = switch_core_session_strdup(tech_pvt->session, route + 9);
@@ -1686,6 +1686,8 @@
}
route_uri = sofia_overcome_sip_uri_weakness(tech_pvt->session, route_uri, 0, SWITCH_TRUE, NULL);
+ } else {
+ route = NULL;
}
if ((val = switch_channel_get_variable(channel, "sip_route_uri"))) {
@@ -1715,7 +1717,7 @@
TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
TAG_IF(tech_pvt->route_uri, NUTAG_PROXY(tech_pvt->route_uri)),
- TAG_IF(route, SIPTAG_ROUTE_STR(route)),
+ TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),
TAG_IF(!switch_strlen_zero(sendto), NUTAG_PROXY(sendto)),
SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c (original)
+++ freeswitch/trunk/src/switch_utils.c Tue Jun 16 08:41:01 2009
@@ -1688,6 +1688,10 @@
char *o;
unsigned int tmp;
+ if (switch_strlen_zero(s)) {
+ return s;
+ }
+
for (o = s; *s; s++, o++) {
if (*s == '%' && strlen(s) > 2 && sscanf(s + 1, "%2x", &tmp) == 1) {
*o = (char) tmp;
More information about the Freeswitch-trunk
mailing list