]> git.pld-linux.org Git - packages/postgresql.git/blame - postgresql-gram.y.patch
- up to 8.1.2
[packages/postgresql.git] / postgresql-gram.y.patch
CommitLineData
0e692124 1--- pgsql/src/pl/plpgsql/src/gram.y 2005/01/21 00:31:21 1.48.2.1
2+++ pgsql/src/pl/plpgsql/src/gram.y 2005/02/07 03:55:28 1.48.2.2
3@@ -4,7 +4,7 @@
4 * procedural language
5 *
6 * IDENTIFICATION
7- * $Header$
8+ * $Header$
9 *
10 * This software is copyrighted by Jan Wieck - Hamburg.
11 *
12@@ -1711,6 +1711,15 @@ read_sql_construct(int until,
13 plpgsql_dstring_append(&ds, yytext);
14 break;
15 }
16+
17+ /* Check for array overflow */
18+ if (nparams >= 1024)
19+ {
20+ plpgsql_error_lineno = lno;
21+ ereport(ERROR,
22+ (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
23+ errmsg("too many variables specified in SQL statement")));
24+ }
25 }
26
27 expr = malloc(sizeof(PLpgSQL_expr) + sizeof(int) * nparams - sizeof(int));
28@@ -1856,6 +1865,15 @@ make_select_stmt(void)
29
30 while ((tok = yylex()) == ',')
31 {
32+ /* Check for array overflow */
33+ if (nfields >= 1024)
34+ {
35+ plpgsql_error_lineno = plpgsql_scanner_lineno();
36+ ereport(ERROR,
37+ (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
38+ errmsg("too many INTO variables specified")));
39+ }
40+
41 tok = yylex();
42 switch(tok)
43 {
44@@ -1918,6 +1936,15 @@ make_select_stmt(void)
45 plpgsql_dstring_append(&ds, yytext);
46 break;
47 }
48+
49+ /* Check for array overflow */
50+ if (nparams >= 1024)
51+ {
52+ plpgsql_error_lineno = plpgsql_scanner_lineno();
53+ ereport(ERROR,
54+ (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
55+ errmsg("too many variables specified in SQL statement")));
56+ }
57 }
58
59 expr = malloc(sizeof(PLpgSQL_expr) + sizeof(int) * nparams - sizeof(int));
60@@ -1989,6 +2016,15 @@ make_fetch_stmt(void)
61
62 while ((tok = yylex()) == ',')
63 {
64+ /* Check for array overflow */
65+ if (nfields >= 1024)
66+ {
67+ plpgsql_error_lineno = plpgsql_scanner_lineno();
68+ ereport(ERROR,
69+ (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
70+ errmsg("too many INTO variables specified")));
71+ }
72+
73 tok = yylex();
74 switch(tok)
75 {
This page took 0.056231 seconds and 4 git commands to generate.