mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +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:
@ -33,6 +33,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "fmgr.h"
|
||||
#include "miscadmin.h"
|
||||
#include "nodes/extensible.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "nodes/plannodes.h"
|
||||
@ -2549,6 +2550,9 @@ parseNodeString(void)
|
||||
|
||||
READ_TEMP_LOCALS();
|
||||
|
||||
/* Guard against stack overflow due to overly complex expressions */
|
||||
check_stack_depth();
|
||||
|
||||
token = pg_strtok(&length);
|
||||
|
||||
#define MATCH(tokname, namelen) \
|
||||
|
Reference in New Issue
Block a user