From ea68c221f4d2351e111ff3d7573ef67a0e9c855a Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Mon, 5 Oct 2015 10:06:30 -0400 Subject: 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). --- contrib/intarray/_int_bool.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib/intarray/_int_bool.c') diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c index 43cc0d42d5c..ac501b474b7 100644 --- a/contrib/intarray/_int_bool.c +++ b/contrib/intarray/_int_bool.c @@ -575,6 +575,9 @@ typedef struct static void infix(INFIX *in, bool first) { + /* since this function recurses, it could be driven to stack overflow. */ + check_stack_depth(); + if (in->curpol->type == VAL) { RESIZEBUF(in, 11); -- cgit v1.2.3