summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-12-01 23:14:29 +0000
committerBruce Momjian <bruce@momjian.us>2003-12-01 23:14:29 +0000
commit0bdc0a6d33c4eef8086cac077efdd66c13241fb6 (patch)
tree32047979501f3998385343603927851e601c98c6
parente1d2c43a22e7f138cd7edb7dc168ce09c823c04a (diff)
I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line. This causes an immediate segfault on systems that fill allocated memory with some value other than zero (my FreeBSD machine uses 0xD0). Several crashes later I discovered that args->user, password, host, and port are also used without being initialized. This doesn't appear to be fixed in CVS and I came up empty on a mailing list search -- hope it hasn't been reported already. Craig Boston
-rw-r--r--contrib/pg_autovacuum/pg_autovacuum.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/pg_autovacuum/pg_autovacuum.c b/contrib/pg_autovacuum/pg_autovacuum.c
index bd92104a4b0..f4e11744347 100644
--- a/contrib/pg_autovacuum/pg_autovacuum.c
+++ b/contrib/pg_autovacuum/pg_autovacuum.c
@@ -811,6 +811,11 @@ get_cmd_args(int argc, char *argv[])
args->analyze_scaling_factor = -1;
args->debug = AUTOVACUUM_DEBUG;
args->daemonize = 0;
+ args->user = 0;
+ args->password = 0;
+ args->host = 0;
+ args->logfile = 0;
+ args->port = 0;
/*
* Fixme: Should add some sanity checking such as positive integer