]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
func_audiohookinheritance: Check If A Channel Was Specified
authorMichael L. Young <elgueromexicano@gmail.com>
Tue, 4 Mar 2014 19:32:21 +0000 (19:32 +0000)
committerMichael L. Young <elgueromexicano@gmail.com>
Tue, 4 Mar 2014 19:32:21 +0000 (19:32 +0000)
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@409623 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_audiohookinherit.c

index f43310bbbc23bfdad223b7284946bf3a3da0e60a..c35e6d46c8a02000d5bdc84a587b5c43a178e633 100644 (file)
@@ -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 */