--- /opt/portbuild/tmp/opt/ports/databases/postgresql74-server/work/postgresql-7.4.7/src/pl/plpgsql/src/pl_gram.c Mon Jan 31 11:20:24 2005 +++ src/pl/plpgsql/src/pl_gram.c Sun Feb 20 02:42:46 2005 @@ -191,7 +191,7 @@ * procedural language * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.48.2.1 2005/01/21 00:31:21 neilc Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.48.2.3 2005/02/08 18:22:11 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -3337,6 +3323,16 @@ } if (plpgsql_SpaceScanned) plpgsql_dstring_append(&ds, " "); + + /* Check for array overflow */ + if (nparams >= 1024) + { + plpgsql_error_lineno = lno; + ereport(ERROR, + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), + errmsg("too many variables specified in SQL statement"))); + } + switch (tok) { case T_VARIABLE: @@ -3494,6 +3490,15 @@ while ((tok = plpgsql_yylex()) == ',') { + /* Check for array overflow */ + if (nfields >= 1024) + { + plpgsql_error_lineno = plpgsql_scanner_lineno(); + ereport(ERROR, + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), + errmsg("too many INTO variables specified"))); + } + tok = plpgsql_yylex(); switch(tok) { @@ -3544,6 +3549,16 @@ if (plpgsql_SpaceScanned) plpgsql_dstring_append(&ds, " "); + + /* Check for array overflow */ + if (nparams >= 1024) + { + plpgsql_error_lineno = plpgsql_scanner_lineno(); + ereport(ERROR, + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), + errmsg("too many variables specified in SQL statement"))); + } + switch (tok) { case T_VARIABLE: @@ -3627,6 +3642,15 @@ while ((tok = plpgsql_yylex()) == ',') { + /* Check for array overflow */ + if (nfields >= 1024) + { + plpgsql_error_lineno = plpgsql_scanner_lineno(); + ereport(ERROR, + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), + errmsg("too many INTO variables specified"))); + } + tok = plpgsql_yylex(); switch(tok) { --- /opt/portbuild/tmp/opt/ports/databases/postgresql74-server/work/postgresql-7.4.7/src/pl/plpgsql/src/pl.tab.h Mon Jan 31 11:20:24 2005 +++ src/pl/plpgsql/src/pl.tab.h Sun Feb 20 06:20:02 2005 @@ -203,7 +203,7 @@ PLpgSQL_stmt_block *program; PLpgSQL_nsitem *nsitem; } PLPGSQL_YYSTYPE; -/* Line 1248 of yacc.c. */ +/* Line 1238 of yacc.c. */ #line 207 "y.tab.h" # define plpgsql_yystype PLPGSQL_YYSTYPE /* obsolescent; will be withdrawn */ # define PLPGSQL_YYSTYPE_IS_DECLARED 1