diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | grammar/rainerscript.c | 9 |
2 files changed, 10 insertions, 3 deletions
@@ -205,6 +205,10 @@ Version 7.4.6 [v7.4-stable] 2013-11-?? Thanks to Pavel Levshin for reporting the problem and its location. - bugfix: memleak in re_extract() function Thanks to Pavel Levshin for reporting this problem. +- bugfix: potential abort in RainerScript optimizer + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=488 + Thanks to Thomas Doll for reporting the problem and Pavel Levshin for + fixing it. - bugfix: memory leak in omhiredis Thanks to Pavel Levshin for the fix - bugfix: segfault if variable was assigned to non-container subtree diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index a2bed2bf..a4cf90bd 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -3055,12 +3055,15 @@ cnfexprOptimize(struct cnfexpr *expr) expr->r = exprswap; } } - if(expr->l->nodetype == 'V') { - expr = cnfexprOptimize_CMP_var(expr); - } if(expr->r->nodetype == 'A') { cnfexprOptimize_CMPEQ_arr((struct cnfarray *)expr->r); } + /* This should be evaluated last because it may change expr + * to a function. + */ + if(expr->l->nodetype == 'V') { + expr = cnfexprOptimize_CMP_var(expr); + } break; case CMP_LE: case CMP_GE: |