]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
PBX: Prevent incorrect hint parsing
authorKinsey Moore <kmoore@digium.com>
Thu, 29 May 2014 15:55:59 +0000 (15:55 +0000)
committerKinsey Moore <kmoore@digium.com>
Thu, 29 May 2014 15:55:59 +0000 (15:55 +0000)
Dynamic and pattern matching hints should not be checked for their last
known state until they are instantiated by subscribers.

(closes issue AFS-56)
Reported by: John Hardin
Patch AFS-56-pbx.diff submitted by Matt Jordan (license 6283)

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

main/pbx.c

index ad87f4ea7de0087a3c69591a28246b1b4a9812b8..8724aab3937169a669d0fe536c10f8974d440b77 100644 (file)
@@ -5247,7 +5247,11 @@ static int ast_add_hint(struct ast_exten *e)
                return -1;
        }
        hint_new->exten = e;
-       hint_new->laststate = ast_extension_state2(e);
+       if (strstr(e->app, "${") && e->exten[0] == '_') {
+               hint_new->laststate = AST_DEVICE_INVALID;
+       } else {
+               hint_new->laststate = ast_extension_state2(e);
+       }
 
        /* Prevent multiple add hints from adding the same hint at the same time. */
        ao2_lock(hints);
@@ -6867,7 +6871,11 @@ static int show_dialplan_helper(int fd, const char *context, const char *exten,
                struct ast_exten *e;
                struct ast_include *i;
                struct ast_ignorepat *ip;
+#ifndef LOW_MEMORY
+               char buf[1024], buf2[1024];
+#else
                char buf[256], buf2[256];
+#endif
                int context_info_printed = 0;
 
                if (context && strcmp(ast_get_context_name(c), context))