diff --git a/src/switch.c b/src/switch.c index 4383c95462..6a56fd90c5 100644 --- a/src/switch.c +++ b/src/switch.c @@ -1240,7 +1240,7 @@ int main(int argc, char *argv[]) int j = 0; switch_sleep(1000000); - if (!argv || execv(argv[0], argv) == -1) { + if (!argv || !argv[0] || execv(argv[0], argv) == -1) { fprintf(stderr, "Restart Failed [%s] resorting to plan b\n", strerror(errno)); for (j = 0; j < argc; j++) { switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", argv[j]); diff --git a/src/switch_channel.c b/src/switch_channel.c index 933317ad81..4283a16231 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -3679,6 +3679,7 @@ static void do_execute_on(switch_channel_t *channel, const char *variable) } } + switch_assert(app != NULL); if (!strncasecmp(app, "perl", 4)) { bg++; } diff --git a/src/switch_core.c b/src/switch_core.c index e03a041200..da17218974 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -270,19 +270,7 @@ SWITCH_DECLARE(void) switch_core_screen_size(int *x, int *y) SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel_t channel) { - FILE *handle = stdout; - - switch (channel) { - case SWITCH_CHANNEL_ID_LOG: - case SWITCH_CHANNEL_ID_LOG_CLEAN: - handle = runtime.console; - break; - default: - handle = runtime.console; - break; - } - - return handle; + return runtime.console; } @@ -2880,7 +2868,7 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void * case SCSC_DEBUG_LEVEL: if (oldintval > -1) { if (oldintval > 10) - newintval = 10; + oldintval = 10; runtime.debug_level = oldintval; } newintval = runtime.debug_level; diff --git a/src/switch_core_file.c b/src/switch_core_file.c index ca5a340214..a009f5b19b 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -43,6 +43,8 @@ static switch_status_t get_file_size(switch_file_handle_t *fh, const char **stri switch_file_t *newfile; switch_size_t size = 0; + switch_assert(string); + status = switch_file_open(&newfile, fh->spool_path ? fh->spool_path : fh->file_path, SWITCH_FOPEN_READ, SWITCH_FPROT_OS_DEFAULT, fh->memory_pool); if (status != SWITCH_STATUS_SUCCESS) {