]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prevent a potential crash when using manager hooks.
authorJason Parker <jparker@digium.com>
Tue, 1 May 2012 21:37:17 +0000 (21:37 +0000)
committerJason Parker <jparker@digium.com>
Tue, 1 May 2012 21:37:17 +0000 (21:37 +0000)
Found by me while poking at DPMA-127.

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

main/manager.c

index 7013e4f82b554eda252cafc3cfde076a38593351..68085120a96fbe9847170820a17dcaf0cb698a94 100644 (file)
@@ -4070,7 +4070,7 @@ static int action_originate(struct mansession *s, const struct message *m)
                format = 0;
                ast_parse_allow_disallow(NULL, &format, codecs, 1);
        }
-       if (!ast_strlen_zero(app)) {
+       if (!ast_strlen_zero(app) && s->session) {
                int bad_appdata = 0;
                /* To run the System application (or anything else that goes to
                 * shell), you must have the additional System privilege */