1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

backend where a statically sized buffer is written to. Most of these

should be pretty safe in practice, but it's probably better to be safe
than sorry.

I was actually looking for cases where NAMEDATALEN is assumed to be
32, but only found one. That's fixed too, as well as a few bits of
code cleanup.

Neil Conway
This commit is contained in:
Bruce Momjian
2002-08-28 20:46:24 +00:00
parent f5fea0808f
commit 81dfa2ce43
13 changed files with 33 additions and 37 deletions

View File

@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.34 2002/08/08 01:36:04 tgl Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.35 2002/08/28 20:46:24 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -1594,7 +1594,7 @@ read_sql_construct(int until,
{
case T_VARIABLE:
params[nparams] = yylval.variable->dno;
sprintf(buf, " $%d ", ++nparams);
snprintf(buf, sizeof(buf), " $%d ", ++nparams);
plpgsql_dstring_append(&ds, buf);
break;
@@ -1791,7 +1791,7 @@ make_select_stmt(void)
{
case T_VARIABLE:
params[nparams] = yylval.variable->dno;
sprintf(buf, " $%d ", ++nparams);
snprintf(buf, sizeof(buf), " $%d ", ++nparams);
plpgsql_dstring_append(&ds, buf);
break;

View File

@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.47 2002/08/22 00:01:50 tgl Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.48 2002/08/28 20:46:24 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -249,7 +249,7 @@ plpgsql_compile(Oid fn_oid, int functype)
{
char buf[32];
sprintf(buf, "$%d", i + 1); /* name for variable */
snprintf(buf, sizeof(buf), "$%d", i + 1); /* name for variable */
/*
* Get the parameters type