diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-27 03:56:35 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-27 03:56:35 +0000 |
commit | dd912c697718e924387dd405413f94e481f8d0d4 (patch) | |
tree | 120239674272c3c65400c56282c46a99b36d521a /src/backend/parser/analyze.c | |
parent | e0a77f56e3e8f44b5014cb7584b33661b2e273e4 (diff) | |
download | postgresql-dd912c697718e924387dd405413f94e481f8d0d4.tar.gz postgresql-dd912c697718e924387dd405413f94e481f8d0d4.zip |
This patches replaces a few more usages of strcpy() and sprintf() when
copying into a fixed-size buffer (in this case, a buffer of
NAMEDATALEN bytes). AFAICT nothing to worry about here, but worth
fixing anyway...
Neil Conway
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r-- | src/backend/parser/analyze.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 1890f01c6f0..01e6d867ce4 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.242 2002/08/19 19:33:34 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.243 2002/08/27 03:56:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -665,7 +665,7 @@ CreateIndexName(char *table_name, char *column_name, * indexes, only among the indexes we're about to create now; this * ought to be improved someday. */ - strcpy(typename, label); + strncpy(typename, label, sizeof(typename)); for (;;) { @@ -685,7 +685,7 @@ CreateIndexName(char *table_name, char *column_name, /* found a conflict, so try a new name component */ pfree(iname); - sprintf(typename, "%s%d", label, ++pass); + snprintf(typename, sizeof(typename), "%s%d", label, ++pass); } return iname; |