Catch stack overflow when recursing in transformFromClauseItem().
authorTom Lane <[email protected]>
Sat, 13 Aug 2022 19:21:28 +0000 (15:21 -0400)
committerTom Lane <[email protected]>
Sat, 13 Aug 2022 19:21:28 +0000 (15:21 -0400)
commit60f876317efc7b9ad624b11ae2f4b8208e408ef4
treea1d861c68c93f91d63116a7a2a2dc92ea3633b4f
parent8b2638fdd4ac87052afb5ebc0d3251bb1ace4bcb
Catch stack overflow when recursing in transformFromClauseItem().

Most parts of the parser can expect that the stack overflow check
in transformExprRecurse() will trigger before things get desperate.
However, transformFromClauseItem() can recurse directly to self
without having analyzed any expressions, so it's possible to drive
it to a stack-overrun crash.  Add a check to prevent that.

Per bug #17583 from Egor Chindyaskin.  Back-patch to all supported
branches.

Richard Guo

Discussion: https://postgr.es/m/17583-33be55b9f981f75c@postgresql.org
src/backend/parser/parse_clause.c