postgresql/src
Tom Lane 2a4c46e0ba Fix array overrun in regex code.
zaptreesubs() was coded to unconditionally reset a capture subre's
corresponding pmatch[] entry.  However, in regexes without backrefs, that
array is caller-supplied and might not have as many entries as the regex
has capturing parens.  So check the array length and do nothing if there
is no corresponding entry, much as subset() does.  Failure to check this
resulted in a stack clobber in the case reported by Marko Kreen.

This bug appears to have been latent in the regex library from the
beginning.  It was not exposed because find() called dissect() not
cdissect(), and the dissect() code path didn't ever call zaptreesubs()
(formerly zapmem()).  When I unified dissect() and cdissect() in commit
4dd78bf37a, the problem was exposed.

Now that I've seen this, I'm rather suspicious that we might need to
back-patch it; but will refrain for now, for lack of evidence that
the case can be hit in the previous coding.
2012-05-24 13:56:16 -04:00
..
backend Fix array overrun in regex code. 2012-05-24 13:56:16 -04:00
bin Add missing PQfinish() calls 2012-05-23 21:52:23 +02:00
include Fix bug in gistRelocateBuildBuffersOnSplit(). 2012-05-18 19:38:32 +03:00
interfaces libpq: Add missing file to GETTEXT_FILES list 2012-05-21 20:08:50 +03:00
makefiles Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
pl Remove whitespace from end of lines 2012-05-15 22:19:41 +03:00
port Fix dependency tracking for src/port/%_srv.o files 2012-05-08 20:10:50 +03:00
template Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
test Fix array overrun in regex code. 2012-05-24 13:56:16 -04:00
timezone Fix edge-case behavior of pg_next_dst_boundary(). 2012-04-25 17:26:10 -04:00
tools Remove whitespace from end of lines 2012-05-15 22:19:41 +03:00
tutorial Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02: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 Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Fix pg_config.h make rule 2012-05-07 21:28:38 +03:00
Makefile.shlib Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
nls-global.mk Lots of doc corrections. 2012-04-23 22:43:09 -04:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00