mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "miscadmin.h"
|
||||
#include "nodes/extensible.h"
|
||||
#include "nodes/relation.h"
|
||||
#include "utils/datum.h"
|
||||
@@ -3002,6 +3003,9 @@ equal(const void *a, const void *b)
|
||||
if (nodeTag(a) != nodeTag(b))
|
||||
return false;
|
||||
|
||||
/* Guard against stack overflow due to overly complex expressions */
|
||||
check_stack_depth();
|
||||
|
||||
switch (nodeTag(a))
|
||||
{
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user