Content-Length: 260181 | pFad | http://github.com/postgrespro/postgres/commit/e07ebd4b6e606a7c03ed3c6bf5d6bcbb725247b4

84 Catch stack overflow when recursing in transformFromClauseItem(). · postgrespro/postgres@e07ebd4 · GitHub
Skip to content

Commit e07ebd4

Browse files
committed
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
1 parent 8ded656 commit e07ebd4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/parser/parse_clause.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,9 @@ transformFromClauseItem(ParseState *pstate, Node *n,
10501050
ParseNamespaceItem **top_nsitem,
10511051
List **namespace)
10521052
{
1053+
/* Guard against stack overflow due to overly deep subtree */
1054+
check_stack_depth();
1055+
10531056
if (IsA(n, RangeVar))
10541057
{
10551058
/* Plain relation reference, or perhaps a CTE reference */

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/e07ebd4b6e606a7c03ed3c6bf5d6bcbb725247b4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy