1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

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
This commit is contained in:
Alexander Korotkov
2024-02-16 16:02:00 +02:00
parent eb49e1bdd9
commit d57b7cc333
5 changed files with 30 additions and 0 deletions

View File

@ -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");