diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-15 02:58:29 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-15 02:58:29 +0000 |
commit | 66eb8df6a4a04922e34dcb2dc543fe231b94903d (patch) | |
tree | 784f595e15219b79a7f4d609b174c155a5c310f7 /contrib/pg_dumplo/utils.c | |
parent | 7f4981f4af1700456f98ac3f2b2d84959919ec81 (diff) |
The attached patch changes most of the usages of sprintf() to
snprintf() in contrib/. I didn't touch the places where pointer
arithmatic was being used, or other areas where the fix wasn't
trivial. I would think that few, if any, of the usages of sprintf()
were actually exploitable, but it's probably better to be paranoid...
Neil Conway
Diffstat (limited to 'contrib/pg_dumplo/utils.c')
-rw-r--r-- | contrib/pg_dumplo/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/pg_dumplo/utils.c b/contrib/pg_dumplo/utils.c index d36ee4be083..aab35bcd7c7 100644 --- a/contrib/pg_dumplo/utils.c +++ b/contrib/pg_dumplo/utils.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- * pg_dumplo * - * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/utils.c,v 1.4 2001/03/22 03:59:10 momjian Exp $ + * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/utils.c,v 1.5 2002/08/15 02:58:29 momjian Exp $ * * Karel Zak 1999-2000 * ------------------------------------------------------------------------- @@ -36,7 +36,7 @@ index_file(LODumpMaster * pgLO) if (pgLO->action == ACTION_SHOW) return; - sprintf(path, "%s/%s", pgLO->space, pgLO->db); + snprintf(path, BUFSIZ, "%s/%s", pgLO->space, pgLO->db); if (pgLO->action == ACTION_EXPORT_ATTR || pgLO->action == ACTION_EXPORT_ALL) @@ -51,7 +51,7 @@ index_file(LODumpMaster * pgLO) } } - sprintf(path, "%s/lo_dump.index", path); + snprintf(path, BUFSIZ, "%s/lo_dump.index", path); if ((pgLO->index = fopen(path, "w")) == NULL) { @@ -63,7 +63,7 @@ index_file(LODumpMaster * pgLO) else if (pgLO->action != ACTION_NONE) { - sprintf(path, "%s/lo_dump.index", path); + snprintf(path, BUFSIZ, "%s/lo_dump.index", path); if ((pgLO->index = fopen(path, "r")) == NULL) { |