Sorry about the cross-post -- I'm not 100% sure which list this should be sent 
to.

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.

Attached is a quick patch that fixes the problem.

--
Craig
--- contrib/pg_autovacuum/pg_autovacuum.c.orig  Fri Nov 21 17:11:32 2003
+++ contrib/pg_autovacuum/pg_autovacuum.c       Fri Nov 21 17:37:28 2003
@@ -811,6 +811,11 @@
        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
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to