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-02-16 16:02:00 +0200
commitd57b7cc3338e9d9aa1d7c5da1b25a17c5a72dcce (patch)
treec70979d3d376696123e38e42f7e9f54fa8f147a0 /src/backend/utils/adt/jsonpath_exec.c
parenteb49e1bdd90b0f0434c01e6e00dedcd9466b5a6e (diff)
downloadpostgresql-d57b7cc3338e9d9aa1d7c5da1b25a17c5a72dcce.tar.gz
postgresql-d57b7cc3338e9d9aa1d7c5da1b25a17c5a72dcce.zip
Add missing check_stack_depth() to some recursive functions
Reported-by: Egor Chindyaskin, Alexander Lakhin Discussion: https://postgr.es/m/1672760457.940462079%40f306.i.mail.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 8372863de74..50fa724b728 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -1674,6 +1674,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");