diff options
author | Neil Conway <neilc@samurai.com> | 2005-04-30 08:08:51 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2005-04-30 08:08:51 +0000 |
commit | 47458f8c2fd97be1637343758223d78fc31f61f8 (patch) | |
tree | 087078deb75ab3a48c99816c4bd6c175f4beae43 /src/bin/initdb/initdb.c | |
parent | 16d4418bf51693cc2528c33f7751bb882f7ad023 (diff) | |
download | postgresql-47458f8c2fd97be1637343758223d78fc31f61f8.tar.gz postgresql-47458f8c2fd97be1637343758223d78fc31f61f8.zip |
GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.
Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.
Diffstat (limited to 'src/bin/initdb/initdb.c')
-rw-r--r-- | src/bin/initdb/initdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 7d424749d62..f4951c3f1bb 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -39,7 +39,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * Portions taken from FreeBSD. * - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.82 2005/04/28 21:47:16 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.83 2005/04/30 08:08:51 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -2609,7 +2609,7 @@ main(int argc, char *argv[]) make_template0(); if (authwarning != NULL) - fprintf(stderr, authwarning); + fprintf(stderr, "%s", authwarning); /* Get directory specification used to start this executable */ strcpy(bin_dir, argv[0]); |