]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5482 skypopen: check assignment on possibly NULL pointer, avoiding segfault
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Thu, 20 Jun 2013 08:16:46 +0000 (10:16 +0200)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Thu, 20 Jun 2013 08:17:52 +0000 (10:17 +0200)
src/mod/endpoints/mod_skypopen/mod_skypopen.c

index 992e77d7206e630e3aa978475ce9e9fce41358ae..482e5b2b1a7fa5553d2cb0fa4004ceca13cc4795 100644 (file)
@@ -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) {