From: Giovanni Maruzzelli Date: Thu, 20 Jun 2013 08:16:46 +0000 (+0200) Subject: FS-5482 skypopen: check assignment on possibly NULL pointer, avoiding segfault X-Git-Tag: v1.5.2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=607ef575bc21dc025a5dc28343e1ac4430a2d25e;p=thirdparty%2Ffreeswitch.git FS-5482 skypopen: check assignment on possibly NULL pointer, avoiding segfault --- diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen.c b/src/mod/endpoints/mod_skypopen/mod_skypopen.c index 992e77d720..482e5b2b1a 100644 --- a/src/mod/endpoints/mod_skypopen/mod_skypopen.c +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen.c @@ -1301,7 +1301,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi switch_copy_string(interface_name, outbound_profile->destination_number, 255); slash = strrchr(interface_name, '/'); - *slash = '\0'; + if(slash != NULL){ + *slash = '\0'; + } switch_mutex_lock(globals.mutex); if (strncmp("ANY", interface_name, strlen(interface_name)) == 0 || strncmp("RR", interface_name, strlen(interface_name)) == 0) {