mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
Add stack depth checks to key recursive functions in backend/nodes/*.c.
Although copyfuncs.c has a check_stack_depth call in its recursion, equalfuncs.c, outfuncs.c, and readfuncs.c lacked one. This seems unwise. Likewise fix planstate_tree_walker(), in branches where that exists. Discussion: https://postgr.es/m/30253.1544286631@sss.pgh.pa.us
This commit is contained in:
@@ -3726,6 +3726,9 @@ planstate_tree_walker(PlanState *planstate,
|
||||
Plan *plan = planstate->plan;
|
||||
ListCell *lc;
|
||||
|
||||
/* Guard against stack overflow due to overly complex plan trees */
|
||||
check_stack_depth();
|
||||
|
||||
/* initPlan-s */
|
||||
if (planstate_walk_subplans(planstate->initPlan, walker, context))
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user