postgresql/src/tools
Noah Misch 2e3bd06654 Add error-throwing wrappers for the printf family of functions.
All known standard library implementations of these functions can fail
with ENOMEM.  A caller neglecting to check for failure would experience
missing output, information exposure, or a crash.  Check return values
within wrappers and code, currently just snprintf.c, that bypasses the
wrappers.  The wrappers do not return after an error, so their callers
need not check.  Back-patch to 9.0 (all supported versions).

Popular free software standard library implementations do take pains to
bypass malloc() in simple cases, but they risk ENOMEM for floating point
numbers, positional arguments, large field widths, and large precisions.
No specification demands such caution, so this commit regards every call
to a printf family function as a potential threat.

Injecting the wrappers implicitly is a compromise between patch scope
and design goals.  I would prefer to edit each call site to name a
wrapper explicitly.  libpq and the ECPG libraries would, ideally, convey
errors to the caller rather than abort().  All that would be painfully
invasive for a back-patched security fix, hence this compromise.

Security: CVE-2015-3166
2015-05-18 10:02:35 -04:00
..
editors emacs.samples: Reliably override ".dir-locals.el". 2014-06-13 19:58:58 -04:00
entab pgindent run for 9.4 2014-05-06 12:12:18 -04:00
findoidjoins Update oidjoins regression test for 9.4. 2014-04-16 14:28:59 -04:00
ifaddrs Update copyright for 2014 2014-01-07 16:05:30 -05:00
make_diff Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
msvc Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:35 -04:00
pginclude pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pgindent Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE' 2014-08-21 19:12:00 -04:00
ccsym Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
check_bison_recursion.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
codelines Fix remaining stray references to CVS. 2010-09-22 19:51:39 -04:00
copyright.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
FAQ2txt Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
find_badmacros Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
find_static Adjust find_status for newer Linux 'nm' output format. 2012-11-13 21:08:07 -05:00
find_typedef Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
git-external-diff Add comment to tools/git-external-diff. 2011-03-11 05:06:31 -05:00
git_changelog pgindent run for 9.4 2014-05-06 12:12:18 -04:00
make_ctags Mention original ctags option name. 2012-02-24 16:19:18 -05:00
make_etags Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
make_mkid Add another pgdefine path check, and a cvs-git change. 2011-08-26 21:52:35 -04:00
pgtest pgtest: allow passing parameters, e.g. -s/--silent 2013-08-05 19:59:52 -04:00
RELEASE_CHANGES Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
valgrind.supp Add Valgrind suppression for reorderbuffer padding bytes. 2014-05-12 23:03:49 -04:00
version_stamp.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
win32tzlist.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00