1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Prevent stack overflow in query-type functions.

The tsquery, ltxtquery and query_int data types have a common ancestor.
Having acquired check_stack_depth() calls independently, each was
missing at least one call.  Back-patch to 9.0 (all supported versions).
This commit is contained in:
Noah Misch
2015-10-05 10:06:30 -04:00
parent acf0da1e64
commit 7bed97d486
4 changed files with 13 additions and 0 deletions

View File

@ -33,6 +33,9 @@ maketree(QueryItem *in)
{
NODE *node = (NODE *) palloc(sizeof(NODE));
/* since this function recurses, it could be driven to stack overflow. */
check_stack_depth();
node->valnode = in;
node->right = node->left = NULL;
if (in->type == QI_OPR)