pgsql: Fix some possible low-memory failures in regexp compilation.

Started by Tom Lanealmost 11 years ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Fix some possible low-memory failures in regexp compilation.

newnfa() failed to set the regex error state when malloc() fails.
Several places in regcomp.c failed to check for an error after calling
subre(). Each of these mistakes could lead to null-pointer-dereference
crashes in memory-starved backends.

Report and patch by Andreas Seltenreich. Back-patch to all branches.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8a0258c31808c514755e3bba03cb052084c4887c

Modified Files
--------------
src/backend/regex/regc_nfa.c | 3 +++
src/backend/regex/regcomp.c | 3 +++
2 files changed, 6 insertions(+)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers