aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath_exec.c
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-02-16 16:02:00 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2024-03-11 02:53:07 +0200
commit98bfb7558a1ab236670f1e6309f336b7d1aafafa (patch)
tree8133fa54f8c6aa78cecb3670b84bae5b6b57dc0d /src/backend/utils/adt/jsonpath_exec.c
parent9301e0f416d1b92299d06786ac28d14885884dd3 (diff)
downloadpostgresql-98bfb7558a1ab236670f1e6309f336b7d1aafafa.tar.gz
postgresql-98bfb7558a1ab236670f1e6309f336b7d1aafafa.zip
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
Diffstat (limited to 'src/backend/utils/adt/jsonpath_exec.c')
-rw-r--r--src/backend/utils/adt/jsonpath_exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 37b08f1742a..e115b03a3d3 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1160,6 +1160,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");