diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_jack.c | 5 | ||||
-rw-r--r-- | apps/app_speech_utils.c | 6 | ||||
-rw-r--r-- | apps/app_stack.c | 10 | ||||
-rw-r--r-- | apps/app_voicemail.c | 4 | ||||
-rw-r--r-- | apps/confbridge/conf_config_parser.c | 5 |
5 files changed, 28 insertions, 2 deletions
diff --git a/apps/app_jack.c b/apps/app_jack.c index d1bdfa38f..f32c59ff0 100644 --- a/apps/app_jack.c +++ b/apps/app_jack.c @@ -951,6 +951,11 @@ static int jack_hook_write(struct ast_channel *chan, const char *cmd, char *data { int res; + if (!chan) { + ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd); + return -1; + } + if (!strcasecmp(value, "on")) res = enable_jack_hook(chan, data); else if (!strcasecmp(value, "off")) diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c index 81afa88ed..e9ca63ea9 100644 --- a/apps/app_speech_utils.c +++ b/apps/app_speech_utils.c @@ -285,7 +285,11 @@ static struct ast_speech *find_speech(struct ast_channel *chan) { struct ast_speech *speech = NULL; struct ast_datastore *datastore = NULL; - + + if (!chan) { + return NULL; + } + datastore = ast_channel_datastore_find(chan, &speech_datastore, NULL); if (datastore == NULL) { return NULL; diff --git a/apps/app_stack.c b/apps/app_stack.c index db335c507..72caed8cb 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -708,6 +708,11 @@ static int local_read(struct ast_channel *chan, const char *cmd, char *data, cha struct gosub_stack_frame *frame; struct ast_var_t *variables; + if (!chan) { + ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd); + return -1; + } + ast_channel_lock(chan); if (!(stack_store = ast_channel_datastore_find(chan, &stack_info, NULL))) { ast_channel_unlock(chan); @@ -742,6 +747,11 @@ static int local_write(struct ast_channel *chan, const char *cmd, char *var, con struct gosub_stack_list *oldlist; struct gosub_stack_frame *frame; + if (!chan) { + ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd); + return -1; + } + ast_channel_lock(chan); if (!(stack_store = ast_channel_datastore_find(chan, &stack_info, NULL))) { ast_log(LOG_ERROR, "Tried to set LOCAL(%s), but we aren't within a Gosub routine\n", var); diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index f86e4c1f9..7db2a2564 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -12092,7 +12092,9 @@ static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, ch } else if (!strncasecmp(arg.attribute, "pager", 5)) { ast_copy_string(buf, vmu->pager, len); } else if (!strncasecmp(arg.attribute, "language", 8)) { - ast_copy_string(buf, S_OR(vmu->language, ast_channel_language(chan)), len); + const char *lang = S_OR(vmu->language, chan ? + ast_channel_language(chan) : ast_defaultlanguage); + ast_copy_string(buf, lang, len); } else if (!strncasecmp(arg.attribute, "locale", 6)) { ast_copy_string(buf, vmu->locale, len); } else if (!strncasecmp(arg.attribute, "tz", 2)) { diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c index 0e81e7e8e..ec841c92c 100644 --- a/apps/confbridge/conf_config_parser.c +++ b/apps/confbridge/conf_config_parser.c @@ -952,6 +952,11 @@ int func_confbridge_helper(struct ast_channel *chan, const char *cmd, char *data AST_APP_ARG(option); ); + if (!chan) { + ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd); + return -1; + } + /* parse all the required arguments and make sure they exist. */ if (ast_strlen_zero(data)) { return -1; |