]> granicus.if.org Git - postgresql/commit
GCC 4.0 includes a new warning option, -Wformat-literal, that emits
authorNeil Conway <neilc@samurai.com>
Sat, 30 Apr 2005 08:19:44 +0000 (08:19 +0000)
committerNeil Conway <neilc@samurai.com>
Sat, 30 Apr 2005 08:19:44 +0000 (08:19 +0000)
commit757956ec47589e1c2c97660f90c89ea0e02a13f7
tree4dcafb8b4ef816ba6d50801595046806c19adbc4
parent7ce01797bd115b0269ee93bc42fe858a7bfb9a47
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.
src/backend/utils/adt/ruleutils.c
src/bin/initdb/initdb.c
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_dump.c