Skip to content

Commit 711804f

Browse files
committed
Prevent #option dump from crashing on FORI statement with null step. Reported by Pavel.
1 parent 9cbcfca commit 711804f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/pl/plpgsql/src/pl_funcs.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.88 2010/01/19 01:35:31 tgl Exp $
11+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.89 2010/02/17 01:48:45 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -543,10 +543,13 @@ dump_fori(PLpgSQL_stmt_fori *stmt)
543543
printf(" upper = ");
544544
dump_expr(stmt->upper);
545545
printf("\n");
546-
dump_ind();
547-
printf(" step = ");
548-
dump_expr(stmt->step);
549-
printf("\n");
546+
if (stmt->step)
547+
{
548+
dump_ind();
549+
printf(" step = ");
550+
dump_expr(stmt->step);
551+
printf("\n");
552+
}
550553
dump_indent -= 2;
551554

552555
dump_stmts(stmt->body);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy