pgsql: Catch stack overflow when recursing in transformFromClauseItem() - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Catch stack overflow when recursing in transformFromClauseItem()
Date
Msg-id E1oMwhh-000dGA-E6@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e07ebd4b6e606a7c03ed3c6bf5d6bcbb725247b4

Modified Files
--------------
src/backend/parser/parse_clause.c | 3 +++
1 file changed, 3 insertions(+)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.
Next
From: Noah Misch
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.