summaryrefslogtreecommitdiff
path: root/funcs
diff options
context:
space:
mode:
authorMichael L. Young <elgueromexicano@gmail.com>2014-03-04 19:34:52 +0000
committerMichael L. Young <elgueromexicano@gmail.com>2014-03-04 19:34:52 +0000
commit959c3a7c154cb77753b83ca71258dd05333eae58 (patch)
treeb03de4af069aee9898f64c9475e2dbf9240fee37 /funcs
parenta0fff439ab84de90d69d0ab1c3d0e3a65ee319bd (diff)
func_audiohookinheritance: Check If A Channel Was Specified
This patch prevents a crash when using the function audiohookinheritance without setting the channel. (closes issue ASTERISK-23104) Reported by: Joel Vandal Tested by: Joel Vandal Patches: asterisk-23104_audiohook_inherit_no_channel-11.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/3272/ ........ Merged revisions 409623 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409625 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 409626 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_audiohookinherit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/funcs/func_audiohookinherit.c b/funcs/func_audiohookinherit.c
index f3a5b6189..ea5c5e9ab 100644
--- a/funcs/func_audiohookinherit.c
+++ b/funcs/func_audiohookinherit.c
@@ -228,6 +228,11 @@ static int func_inheritance_write(struct ast_channel *chan, const char *function
return -1;
}
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to INHERITANCE function.\n");
+ return -1;
+ }
+
allow = ast_true(value);
/* Step 2: retrieve or set up datastore */