]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix some possible low-memory failures in regexp compilation.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Aug 2015 04:48:11 +0000 (00:48 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Aug 2015 04:48:34 +0000 (00:48 -0400)
commita35a527f2d6b28f78e9eab42801ec0170ffcb898
tree8886ec53613edd73cd4b62e20d6831bbb5f0d77e
parente9a080d3692893081306fee262565ba87080dfd0
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.
src/backend/regex/regc_nfa.c
src/backend/regex/regcomp.c