diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2024-02-16 16:02:00 +0200 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2024-03-11 03:06:55 +0200 |
commit | 7607671826dd3050b2656700cf1a9cc99a73a4df (patch) | |
tree | 8c9cb2702dacc07ec41c23cc8ea44823144594f9 /src/backend/utils/adt/jsonpath_exec.c | |
parent | 6a9e2cb2b457d962bc3952931a05ad7d5b5be252 (diff) | |
download | postgresql-7607671826dd3050b2656700cf1a9cc99a73a4df.tar.gz postgresql-7607671826dd3050b2656700cf1a9cc99a73a4df.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.c | 3 |
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 2d0599b4aaa..5c25bc1e430 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -1232,6 +1232,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"); |