# HG changeset patch # User Bram Moolenaar # Date 1577040303 -3600 # Node ID c62d63d2b9f0a7d97836a3121a74c9c7b83f42dd # Parent e90fc3f5a0ae71c37caf577ea260ede62e19dc97 patch 8.2.0033: crash when make_extmatch() runs out of memory Commit: https://github.com/vim/vim/commit/7c77b3496710f1be3232cfdc7f6812347fbd914a Author: Bram Moolenaar Date: Sun Dec 22 19:40:40 2019 +0100 patch 8.2.0033: crash when make_extmatch() runs out of memory Problem: Crash when make_extmatch() runs out of memory. Solution: Check for NULL. (Dominique Pelle, closs https://github.com/vim/vim/issues/5392) diff --git a/src/regexp_bt.c b/src/regexp_bt.c --- a/src/regexp_bt.c +++ b/src/regexp_bt.c @@ -4568,6 +4568,8 @@ regtry( cleanup_zsubexpr(); re_extmatch_out = make_extmatch(); + if (re_extmatch_out == NULL) + return 0; for (i = 0; i < NSUBEXP; i++) { if (REG_MULTI) diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c --- 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++) { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 33, +/**/ 32, /**/ 31,