summaryrefslogtreecommitdiff
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-22 19:40:40 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-22 19:40:40 +0100
commit7c77b3496710f1be3232cfdc7f6812347fbd914a (patch)
tree01d299dccb0ad0645eb1a01fa07d1c49a01136cf /src/regexp_nfa.c
parent7c2a2f869b0f5a3e36f5e7d83923a264426e434c (diff)
downloadvim-git-7c77b3496710f1be3232cfdc7f6812347fbd914a.tar.gz
patch 8.2.0033: crash when make_extmatch() runs out of memoryv8.2.0033
Problem: Crash when make_extmatch() runs out of memory. Solution: Check for NULL. (Dominique Pelle, closs #5392)
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index fb512f961..a288ea47c 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -7070,6 +7070,8 @@ nfa_regtry(
{
cleanup_zsubexpr();
re_extmatch_out = make_extmatch();
+ if (re_extmatch_out == NULL)
+ return 0;
// Loop over \z1, \z2, etc. There is no \z0.
for (i = 1; i < subs.synt.in_use; i++)
{