From 445c7e38f65f4abee1e55b31a849c31b18d99d4b Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Fri, 16 Feb 2024 16:02:00 +0200 Subject: Backpatch missing check_stack_depth() to some recursive functions Backpatch changes from d57b7cc333, 75bcba6cbd to all supported branches per proposal of Egor Chindyaskin. Discussion: https://postgr.es/m/DE5FD776-A8CD-4378-BCFA-3BF30F1F6D60%40mail.ru --- src/backend/utils/adt/jsonpath_exec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/backend/utils/adt/jsonpath_exec.c') diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index bbb3125c1d1..ee97a62d105 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -1235,6 +1235,9 @@ executeBoolItem(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonPathBool res; JsonPathBool res2; + /* since this function recurses, it could be driven to stack overflow */ + check_stack_depth(); + if (!canHaveNext && jspHasNext(jsp)) elog(ERROR, "boolean jsonpath item cannot have next item"); -- cgit v1.2.3