postgresql/src
Tom Lane b63fc28776 Add recursion depth protections to regular expression matching.
Some of the functions in regex compilation and execution recurse, and
therefore could in principle be driven to stack overflow.  The Tcl crew
has seen this happen in practice in duptraverse(), though their fix was
to put in a hard-wired limit on the number of recursive levels, which is
not too appetizing --- fortunately, we have enough infrastructure to check
the actually available stack.  Greg Stark has also seen it in other places
while fuzz testing on a machine with limited stack space.  Let's put guards
in to prevent crashes in all these places.

Since the regex code would leak memory if we simply threw elog(ERROR),
we have to introduce an API that checks for stack depth without throwing
such an error.  Fortunately that's not difficult.
2015-10-02 14:51:58 -04:00
..
backend Add recursion depth protections to regular expression matching. 2015-10-02 14:51:58 -04:00
bin pg_rewind: Improve some messages 2015-10-01 21:42:00 -04:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Add recursion depth protections to regular expression matching. 2015-10-02 14:51:58 -04:00
interfaces Fix poor errno handling in libpq's version of our custom OpenSSL BIO. 2015-09-28 18:02:38 -04:00
makefiles Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
pl Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00
port Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
template Attempt to work around a 32bit xlc compiler bug from a different place. 2015-08-08 01:19:02 +02:00
test Fix potential infinite loop in regular expression execution. 2015-10-02 14:26:36 -04:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:35:29 -04:00
tools Add a Gather executor node. 2015-09-30 19:23:36 -04:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -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 Don't try to create a temp install without abs_top_builddir. 2015-09-28 10:49:59 -04:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:26 -04: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