diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-18 21:33:57 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-18 21:33:57 +0000 |
commit | af442a3e3598f8c207c999ee66c202a370303d9e (patch) | |
tree | cb5064e647f8553e11e61dbb064a0d10afdb1cb1 /pbx | |
parent | f35da32eb140cf5d6a424e1b84d8c5717b2ff40e (diff) |
Merged revisions 271483 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r271483 | jpeeler | 2010-06-18 16:32:09 -0500 (Fri, 18 Jun 2010) | 18 lines
Merged revisions 271399 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r271399 | jpeeler | 2010-06-18 14:28:24 -0500 (Fri, 18 Jun 2010) | 11 lines
Fix crash when parsing some heavily nested statements in AEL on reload.
Due to the recursion used when compiling AEL in gen_prios, all the stack space
was being consumed when parsing some AEL that contained nesting 13 levels deep.
Changing a few large buffers to be heap allocated fixed the crash, although I
did not test how many more levels can now be safely used.
(closes issue #16053)
Reported by: diLLec
Tested by: jpeeler
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@271484 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_ael.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c index f1b8fb00e..f4decbf80 100644 --- a/pbx/pbx_ael.c +++ b/pbx/pbx_ael.c @@ -95,7 +95,7 @@ struct ael_extension *new_exten(void); void destroy_extensions(struct ael_extension *exten); void set_priorities(struct ael_extension *exten); void add_extensions(struct ael_extension *exten); -void ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *local_table, struct pval *root); +int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *local_table, struct pval *root); void destroy_pval(pval *item); void destroy_pval_item(pval *item); int is_float(char *arg ); @@ -137,7 +137,11 @@ static int pbx_load_module(void) if (errs == 0 && sem_err == 0) { ast_log(LOG_NOTICE, "AEL load process: checked config file name '%s'.\n", rfilename); local_table = ast_hashtab_create(11, ast_hashtab_compare_contexts, ast_hashtab_resize_java, ast_hashtab_newsize_java, ast_hashtab_hash_contexts, 0); - ast_compile_ael2(&local_contexts, local_table, parse_tree); + if (ast_compile_ael2(&local_contexts, local_table, parse_tree)) { + ast_log(LOG_ERROR, "AEL compile failed! Aborting.\n"); + destroy_pval(parse_tree); /* free up the memory */ + return AST_MODULE_LOAD_DECLINE; + } ast_log(LOG_NOTICE, "AEL load process: compiled config file name '%s'.\n", rfilename); ast_merge_contexts_and_delete(&local_contexts, local_table, registrar); |