postgresql/src
Noah Misch ca325941d5 Check return values of sensitive system library calls.
PostgreSQL already checked the vast majority of these, missing this
handful that nearly cannot fail.  If putenv() failed with ENOMEM in
pg_GSS_recvauth(), authentication would proceed with the wrong keytab
file.  If strftime() returned zero in cache_locale_time(), using the
unspecified buffer contents could lead to information exposure or a
crash.  Back-patch to 9.0 (all supported versions).

Other unchecked calls to these functions, especially those in frontend
code, pose negligible security concern.  This patch does not address
them.  Nonetheless, it is always better to check return values whose
specification provides for indicating an error.

In passing, fix an off-by-one error in strftime_win32()'s invocation of
WideCharToMultiByte().  Upon retrieving a value of exactly MAX_L10N_DATA
bytes, strftime_win32() would overrun the caller's buffer by one byte.
MAX_L10N_DATA is chosen to exceed the length of every possible value, so
the vulnerable scenario probably does not arise.

Security: CVE-2015-3166
2015-05-18 10:02:35 -04:00
..
backend Check return values of sensitive system library calls. 2015-05-18 10:02:35 -04:00
bin Translation updates 2015-05-18 08:38:34 -04:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
include Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:35 -04:00
interfaces Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:35 -04:00
makefiles Remove USE_VPATH make variable from PGXS 2014-12-04 08:45:48 -05:00
pl Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:35 -04:00
port Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:35 -04:00
template Revert to using --enable-auto-import in Cygwin builds. 2014-02-16 15:14:04 -05:00
test Fix incorrect checking of deferred exclusion constraint after a HOT update. 2015-05-11 12:25:44 -04:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:35:51 -04:00
tools Add error-throwing wrappers for the printf family of functions. 2015-05-18 10:02:35 -04:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Fix installcheck case for tap tests 2014-12-24 10:32:02 -05:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00