postgresql/src/pl/plpython
Noah Misch 82b7393eb4 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:37 -04:00
..
expected Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:02:18 -04:00
po Translation updates 2015-05-18 08:45:56 -04:00
sql Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:02:18 -04:00
.gitignore PL/Python: Adjust the regression tests for Python 3.4 2014-06-01 15:03:18 -04:00
generate-spiexceptions.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
Makefile On OS X, link libpython normally, ignoring the "framework" framework. 2014-05-30 18:18:20 -04:00
nls.mk Translation updates 2013-02-04 00:01:19 -05:00
plpy_cursorobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_cursorobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_elog.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
plpy_elog.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_exec.c Fix thinko in plpython error message 2015-01-06 15:16:29 -03:00
plpy_exec.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_main.c Fix some functions that were declared static then defined not-static. 2015-01-12 16:08:52 -05:00
plpy_main.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_planobject.c PL/Python: Add argument names to function declarations 2011-12-29 22:55:49 +02:00
plpy_planobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_plpymodule.c Fix some functions that were declared static then defined not-static. 2015-01-12 16:08:52 -05:00
plpy_plpymodule.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_procedure.c Silence compiler warning in assertion-enabled builds. 2013-07-02 17:51:50 +03:00
plpy_procedure.h Fix plpython's handling of functions used as triggers on multiple tables. 2013-01-25 16:59:00 -05:00
plpy_resultobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_resultobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_spi.c Fix error handling in PLy_spi_execute_fetch_result(). 2013-07-20 12:45:02 -04:00
plpy_spi.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.h add #includes to plpy_subxactobject.h to make it compile standalone 2012-08-28 16:14:31 -04:00
plpy_typeio.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
plpy_typeio.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_util.c Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
plpy_util.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpython.h Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:37 -04:00
plpython2u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython2u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython2u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython3u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpythonu--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00