Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ca36155

Browse files
committed
Check for stack overrun in standard_ProcessUtility().
ProcessUtility can recurse, and indeed can be driven to infinite recursion, so it ought to have a check_stack_depth() call. This covers the reported bug (portal trying to execute itself) and a bunch of other cases that could perhaps arise somewhere. Per bug #15428 from Malthe Borch. Back-patch to all supported branches. Discussion: https://postgr.es/m/15428-b3c2915ec470b033@postgresql.org
1 parent a05f705 commit ca36155

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/tcop/utility.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ standard_ProcessUtility(Node *parsetree,
359359
{
360360
bool isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL);
361361

362+
/* This can recurse, so check for excessive recursion */
363+
check_stack_depth();
364+
362365
check_xact_readonly(parsetree);
363366

364367
if (completionTag)

0 commit comments

Comments
 (0)