]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix segfault regression from r370681
authorKinsey Moore <kmoore@digium.com>
Wed, 10 Oct 2012 13:35:53 +0000 (13:35 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 10 Oct 2012 13:35:53 +0000 (13:35 +0000)
Due to usage of ast_hook_send_action, AMI action handling code should
be able to handle a NULL mansession->session.  This would cause a crash
on NULL dereference if action_originate was called from
ast_hook_send_action.

(closes issue ASTERISK-20544)

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

main/manager.c

index 3a2dd3f9271a27f32682f35e01e28460a25e4dd6..48bb0917a9d3cb27f51621b5a425409b0b93d659 100644 (file)
@@ -4369,7 +4369,7 @@ static int action_originate(struct mansession *s, const struct message *m)
 
        /* Allocate requested channel variables */
        vars = astman_get_variables(m);
-       if (s->session->chanvars) {
+       if (s->session && s->session->chanvars) {
                struct ast_variable *v, *old;
                old = vars;
                vars = NULL;