Commit 533d630d authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*fixed segfault (affects all flavors) where creating an expr object with more...

*fixed segfault (affects all flavors) where creating an expr object with more than MAX_VARS variables (currently set to 9) crashed pd when freeing the object. Example: create [expr 1;2;3;4;5;6;7;8;9;10] as opposed to [expr 1;2;3;4;5;6;7;8;9]. Former crashes when being freed (destroyed), while latter doesn't.
parent 43a2cb9d
......@@ -265,6 +265,11 @@ expr_donew(struct expr *expr, int ac, t_atom *av)
(struct ex_ex *)fts_malloc(max_node * sizeof (struct ex_ex));
expr->exp_nexpr++;
ret = ex_match(list, (long)0);
if (expr->exp_nexpr > MAX_VARS) // we cannot exceed the number of max vars (arbitrarily set to 9 in vexp.h)
{
post_error((fts_object_t *) expr, "expr: too many variables (maximum %d allowed)", MAX_VARS);
goto error;
}
if (!ret) /* syntax error */
goto error;
ret = ex_parse(expr,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment