postgresql/contrib
Tom Lane 655b665f74 Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit.  We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun is not really a security
issue.  Nonetheless it seems prudent to forestall any risk by using
strlcpy() and similar functions.

Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports.

In addition, fix a potential null-pointer-dereference crash in
contrib/chkpass.  The crypt(3) function is defined to return NULL on
failure, but chkpass.c didn't check for that before using the result.
The main practical case in which this could be an issue is if libc is
configured to refuse to execute unapproved hashing algorithms (e.g.,
"FIPS mode").  This ideally should've been a separate commit, but
since it touches code adjacent to one of the buffer overrun changes,
I included it in this commit to avoid last-minute merge issues.
This issue was reported by Honza Horak.

Security: CVE-2014-0065 for buffer overruns, CVE-2014-0066 for crypt()
2014-02-17 11:20:27 -05:00
..
adminpack Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
auth_delay Limit values of archive_timeout, post_auth_delay, auth_delay.milliseconds. 2012-11-18 17:15:11 -05:00
auto_explain Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
btree_gin Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
btree_gist Make contrib/btree_gist's GiST penalty function a bit saner. 2013-02-07 19:14:08 -05:00
chkpass Prevent potential overruns of fixed-size buffers. 2014-02-17 11:20:27 -05:00
citext Fix contrib/citext's upgrade script to handle array and domain cases. 2012-05-11 15:22:30 -04:00
cube Fix contrib/cube and contrib/seg to build with bison 3.0. 2013-07-29 10:42:44 -04:00
dblink Fix performance regression in dblink connection speed. 2013-12-07 16:59:35 -08:00
dict_int Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dict_xsyn Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dummy_seclabel Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
earthdistance Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
file_fdw Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
fuzzystrmatch Even more duplicate word removal, in the spirit of the season 2012-05-02 20:56:03 +03:00
hstore Predict integer overflow to avoid buffer overruns. 2014-02-17 09:33:33 -05:00
intagg Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
intarray Predict integer overflow to avoid buffer overruns. 2014-02-17 09:33:33 -05:00
isn Fix calculation of ISMN check digit. 2014-01-13 15:44:02 +02:00
lo Defend against bad trigger definitions in contrib/lo's lo_manage() trigger. 2013-11-23 22:46:08 -05:00
ltree Predict integer overflow to avoid buffer overruns. 2014-02-17 09:33:33 -05:00
oid2name Work around unportable behavior of malloc(0) and realloc(NULL, 0). 2012-10-02 17:31:49 -04:00
pageinspect Take buffer lock while inspecting btree index pages in contrib/pageinspect. 2012-11-30 17:02:35 -05:00
passwordcheck Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pg_archivecleanup Make documentation of --help and --version options more consistent 2012-06-18 02:47:53 +03:00
pg_buffercache Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
pg_freespacemap Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
pg_standby Prevent potential overruns of fixed-size buffers. 2014-02-17 11:20:27 -05:00
pg_stat_statements Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_test_fsync Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_test_timing Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_trgm Fix possible buffer overrun in contrib/pg_trgm. 2014-01-13 13:07:17 -05:00
pg_upgrade Fix potential coredump on bad locale value in pg_upgrade. 2014-01-30 18:10:06 -05:00
pg_upgrade_support Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pgbench Work around unportable behavior of malloc(0) and realloc(NULL, 0). 2012-10-02 17:31:49 -04:00
pgcrypto Fix pgp_pub_decrypt() so it works for secret keys with passwords. 2013-05-10 13:06:52 -04:00
pgrowlocks Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
pgstattuple Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
seg Fix contrib/cube and contrib/seg to build with bison 3.0. 2013-07-29 10:42:44 -04:00
sepgsql Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
spi Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
sslinfo Lots of doc corrections. 2012-04-23 22:43:09 -04:00
start-scripts Support Linux's oom_score_adj API as well as the older oom_adj API. 2012-06-13 15:35:52 -04:00
tablefunc Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
tcn Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY. 2012-11-29 10:37:13 -05:00
test_parser Fix one-byte buffer overrun in contrib/test_parser. 2012-01-09 19:56:27 -05:00
tsearch2 Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
unaccent Fix some typos 2012-04-22 19:23:47 +03:00
uuid-ossp Fix quoting in help messages in uuid-ossp extension scripts. 2013-11-22 12:08:19 -05:00
vacuumlo Make documentation of --help and --version options more consistent 2012-06-18 02:47:53 +03:00
xml2 Prevent access to external files/URLs via contrib/xml2's xslt_process(). 2012-08-14 18:31:43 -04:00
contrib-global.mk Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Makefile pg_test_timing utility, to measure clock monotonicity and timing cost. 2012-03-27 16:14:00 -04:00
README Update contrib/README 2012-04-14 09:29:54 +03:00

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "gmake all" and "gmake
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.