From b3168a76c924a99302e54b821053939a4686ca53 Mon Sep 17 00:00:00 2001 From: Steve Murphy Date: Mon, 1 Oct 2007 23:03:50 +0000 Subject: Merged revisions 84239 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84239 | murf | 2007-10-01 14:27:52 -0600 (Mon, 01 Oct 2007) | 1 line closes issue #10777 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84327 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/ael/ael.tab.c | 2 +- res/ael/ael.y | 2 +- res/ael/pval.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'res/ael') diff --git a/res/ael/ael.tab.c b/res/ael/ael.tab.c index c6d2ce4a6..1864c184f 100644 --- a/res/ael/ael.tab.c +++ b/res/ael/ael.tab.c @@ -2137,8 +2137,8 @@ yyreduce: if (!(yyvsp[(5) - (6)].pval)) { ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Warning! The empty context %s will be IGNORED!\n", my_file, (yylsp[(4) - (6)]).first_line, (yylsp[(4) - (6)]).first_column, (yylsp[(4) - (6)]).last_column, (yyvsp[(3) - (6)].str) ); + (yyval.pval) = 0; free((yyvsp[(3) - (6)].str)); - } else { (yyval.pval) = npval2(PV_CONTEXT, &(yylsp[(1) - (6)]), &(yylsp[(6) - (6)])); (yyval.pval)->u1.str = (yyvsp[(3) - (6)].str); diff --git a/res/ael/ael.y b/res/ael/ael.y index ed48d4866..42d86c008 100644 --- a/res/ael/ael.y +++ b/res/ael/ael.y @@ -205,8 +205,8 @@ context : opt_abstract KW_CONTEXT context_name LC elements RC { if (!$5) { ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Warning! The empty context %s will be IGNORED!\n", my_file, @4.first_line, @4.first_column, @4.last_column, $3 ); + $$ = 0; free($3); - } else { $$ = npval2(PV_CONTEXT, &@1, &@6); $$->u1.str = $3; diff --git a/res/ael/pval.c b/res/ael/pval.c index 11c72532c..960c3eca5 100644 --- a/res/ael/pval.c +++ b/res/ael/pval.c @@ -2871,6 +2871,8 @@ void ael2_semantic_check(pval *item, int *arg_errs, int *arg_warns, int *arg_not #endif struct argapp *apps=0; + if (!item) + return; /* don't check an empty tree */ #ifdef AAL_ARGCHECK rfilename = alloca(10 + strlen(ast_config_AST_VAR_DIR)); sprintf(rfilename, "%s/applist", ast_config_AST_VAR_DIR); -- cgit v1.2.3