aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_tar.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-08-28 20:46:24 +0000
committerBruce Momjian <bruce@momjian.us>2002-08-28 20:46:24 +0000
commit81dfa2ce4328c44201a70a9dc3517bd356698069 (patch)
treeec11b0649abcb6cd2b3cb6926ff4df21ac1e570d /src/bin/pg_dump/pg_backup_tar.c
parentf5fea0808f385677dccffa0b4dc0ffe512cb4199 (diff)
downloadpostgresql-81dfa2ce4328c44201a70a9dc3517bd356698069.tar.gz
postgresql-81dfa2ce4328c44201a70a9dc3517bd356698069.zip
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
Diffstat (limited to 'src/bin/pg_dump/pg_backup_tar.c')
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 38c84d9b482..87f53e17d55 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.25 2002/08/20 17:54:44 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.26 2002/08/28 20:46:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1189,12 +1189,10 @@ static void
_tarWriteHeader(TAR_MEMBER *th)
{
char h[512];
- int i;
int lastSum = 0;
int sum;
- for (i = 0; i < 512; i++)
- h[i] = '\0';
+ memset(h, 0, sizeof(h));
/* Name 100 */
sprintf(&h[0], "%.99s", th->targetFile);