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 03:06:15 +0200
commit84cc1a5527564beef86ba500d8318e2f659f6969 (patch)
tree1a37fb0329f81f0465c0a1a3215b113d0f9ea84b /src/backend/utils/adt/jsonpath_exec.c
parent628c3f2e17fef9cee9329f8d142db6a69105c681 (diff)
downloadpostgresql-84cc1a5527564beef86ba500d8318e2f659f6969.tar.gz
postgresql-84cc1a5527564beef86ba500d8318e2f659f6969.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 ae1a9f86052..10ec66c6293 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1231,6 +1231,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");