1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

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
This commit is contained in:
Bruce Momjian
2002-08-27 03:56:35 +00:00
parent e0a77f56e3
commit dd912c6977
5 changed files with 18 additions and 18 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.76 2002/08/26 17:53:58 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.77 2002/08/27 03:56:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -136,9 +136,9 @@ aclparse(const char *s, AclItem *aip, unsigned *modechg)
*s != ACL_MODECHG_EQL_CHR)
{
/* we just read a keyword, not a name */
if (strcmp(name, ACL_IDTYPE_GID_KEYWORD) == 0)
if (strncmp(name, ACL_IDTYPE_GID_KEYWORD, sizeof(name)) == 0)
idtype = ACL_IDTYPE_GID;
else if (strcmp(name, ACL_IDTYPE_UID_KEYWORD) != 0)
else if (strncmp(name, ACL_IDTYPE_UID_KEYWORD, sizeof(name)) != 0)
elog(ERROR, "aclparse: bad keyword, must be [group|user]");
s = getid(s, name); /* move s to the name beyond the keyword */
if (name[0] == '\0')

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.51 2002/08/09 16:45:14 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.52 2002/08/27 03:56:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,7 +95,7 @@ SetDefine(char *querystr, Oid elemType)
if (strcmp(procname, NameStr(proc->proname)) == 0)
{
/* make the real proc name */
sprintf(realprocname, "set%u", setoid);
snprintf(realprocname, sizeof(realprocname), "set%u", setoid);
/* set up the attributes to be modified or kept the same */
repl[0] = 'r';