summaryrefslogtreecommitdiff
path: root/src/backend/nodes/nodeFuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-12-10 11:12:43 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-12-10 11:12:43 -0500
commite60122b54daf6f0e93162161b41ecb9ab4655fa5 (patch)
tree5db10e020194c4ec6108f2d44d0c1dbd146be086 /src/backend/nodes/nodeFuncs.c
parent9eaba23c414d9da1e767e1af0a80cb687dc358e2 (diff)
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
Diffstat (limited to 'src/backend/nodes/nodeFuncs.c')
-rw-r--r--src/backend/nodes/nodeFuncs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
index e3eb0c57887..ba119a2e596 100644
--- a/src/backend/nodes/nodeFuncs.c
+++ b/src/backend/nodes/nodeFuncs.c
@@ -3701,6 +3701,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;