]> granicus.if.org Git - vim/commitdiff
patch 8.2.0033: crash when make_extmatch() runs out of memory v8.2.0033
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Dec 2019 18:40:40 +0000 (19:40 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Dec 2019 18:40:40 +0000 (19:40 +0100)
Problem:    Crash when make_extmatch() runs out of memory.
Solution:   Check for NULL. (Dominique Pelle, closs #5392)

src/regexp_bt.c
src/regexp_nfa.c
src/version.c

index b71b86205624a74eec2411f389ffd02e49f7aba8..78be2b5f8dfc2074bf0a4244f233ce4fec14d2c2 100644 (file)
@@ -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)
index fb512f9610e8ae098bb3bd5289da5f9a55756203..a288ea47c84036ee769ae08c0c7f9d23087dab5c 100644 (file)
@@ -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++)
        {
index 88ea9247d3834ddb426a1a7bd2e40aea113c9e0c..3c2c49bd6d84de31697fe9d673350f3e0cc1d187 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    33,
 /**/
     32,
 /**/