diff --git a/src/cfgparse.y b/src/cfgparse.y index 3ba788a9..790ae3be 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -393,18 +393,22 @@ new_container: } | TOKNEWCONTAINER WHITESPACE TOKSTACKLIMIT WHITESPACE TOKSTACKLIMIT WHITESPACE NUMBER { - DLOG("stack-limit %d with val %d\n", $5, $7); - config.container_stack_limit = $5; - config.container_stack_limit_value = $7; + if ($7 <= 0) { + ELOG("Invalid stack-limit, need a limit which is > 0\n"); + } else { + DLOG("stack-limit %d with val %d\n", $5, $7); + config.container_stack_limit = $5; + config.container_stack_limit_value = $7; - /* See the comment above */ - Workspace *ws; - TAILQ_FOREACH(ws, workspaces, workspaces) { - if (ws->table == NULL) - continue; - Container *con = ws->table[0][0]; - con->stack_limit = config.container_stack_limit; - con->stack_limit_value = config.container_stack_limit_value; + /* See the comment above */ + Workspace *ws; + TAILQ_FOREACH(ws, workspaces, workspaces) { + if (ws->table == NULL) + continue; + Container *con = ws->table[0][0]; + con->stack_limit = config.container_stack_limit; + con->stack_limit_value = config.container_stack_limit_value; + } } } ;