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

From Tom Lane
Subject pgsql: Fix some possible low-memory failures in regexp compilation.
Date
Msg-id E1ZPNyY-00071I-JA@gemulon.postgresql.org
Whole thread Raw
List 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_5_STABLE

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

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


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix some possible low-memory failures in regexp compilation.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix some possible low-memory failures in regexp compilation.