]> granicus.if.org Git - vim/commitdiff
patch 8.2.3883: crash when switching to other regexp engine fails v8.2.3883
authorBram Moolenaar <Bram@vim.org>
Fri, 24 Dec 2021 16:46:14 +0000 (16:46 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 24 Dec 2021 16:46:14 +0000 (16:46 +0000)
Problem:    Crash when switching to other regexp engine fails.
Solution:   Check for regprog being NULL.

src/ex_cmds.c
src/version.c

index 10c8e617c9a112fa900f4a79550b3d290ed236ca..14045267da0c89c9fdf4280758d9a7e37661d966 100644 (file)
@@ -4975,6 +4975,8 @@ ex_global(exarg_T *eap)
            // a match on this line?
            match = vim_regexec_multi(&regmatch, curwin, curbuf, lnum,
                                                       (colnr_T)0, NULL, NULL);
+           if (regmatch.regprog == NULL)
+               break;  // re-compiling regprog failed
            if ((type == 'g' && match) || (type == 'v' && !match))
            {
                ml_setmarked(lnum);
index a77aa046f346d32238664dfb932f508142a94f18..05b8120a98c7f56365ee3211a6d0074345b009bb 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3883,
 /**/
     3882,
 /**/