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:45 +0200 |
commit | 84788ee5b4ee5a7ee7543c8dce9f270101f352f1 (patch) | |
tree | 329e93cf7d4f08074d3bb665ad611d8325055e52 /src/backend/utils/adt/jsonpath_exec.c | |
parent | ab64b275ad8f3bd15a3aa77308620fad80e07b62 (diff) | |
download | postgresql-84788ee5b4ee5a7ee7543c8dce9f270101f352f1.tar.gz postgresql-84788ee5b4ee5a7ee7543c8dce9f270101f352f1.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 c8368eacb64..f7edfb352e8 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"); |