mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Replace max_expr_depth parameter with a max_stack_depth parameter that
is measured in kilobytes and checked against actual physical execution stack depth, as per my proposal of 30-Dec. This gives us a fairly bulletproof defense against crashing due to runaway recursive functions.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.166 2004/03/21 22:29:11 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.167 2004/03/24 22:40:28 tgl Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -2347,6 +2347,10 @@ expression_tree_walker(Node *node,
|
||||
*/
|
||||
if (node == NULL)
|
||||
return false;
|
||||
|
||||
/* Guard against stack overflow due to overly complex expressions */
|
||||
check_stack_depth();
|
||||
|
||||
switch (nodeTag(node))
|
||||
{
|
||||
case T_Var:
|
||||
@@ -2720,6 +2724,10 @@ expression_tree_mutator(Node *node,
|
||||
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Guard against stack overflow due to overly complex expressions */
|
||||
check_stack_depth();
|
||||
|
||||
switch (nodeTag(node))
|
||||
{
|
||||
case T_Var:
|
||||
|
||||
Reference in New Issue
Block a user