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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix some possible low-memory failures in regexp compilation.
Date: 2015-08-12 04:49:18
Message-ID: E1ZPNyY-00071K-JN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/a35a527f2d6b28f78e9eab42801ec0170ffcb898

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

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2015-08-12 06:09:21 Re: pgsql: Optionally don't error out due to preexisting slots in commandli
Previous Message Tom Lane 2015-08-12 03:48:51 pgsql: Postpone extParam/allParam calculations until the very end of pl