]> granicus.if.org Git - vim/commitdiff
patch 8.1.2147: crash when allocating memory fails v8.1.2147
authorBram Moolenaar <Bram@vim.org>
Sun, 13 Oct 2019 17:49:26 +0000 (19:49 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 Oct 2019 17:49:26 +0000 (19:49 +0200)
Problem:    Crash when allocating memory fails. (Zu-Ming Jiang)
Solution:   Check that 'spellcapcheck' is not NULL. (closes #5048)

src/spell.c
src/version.c

index 607bb392e52aa096149abfdb898eefd573d698ed..04e4af601ffef323ce6a5f4eb14495f869e32b45 100644 (file)
@@ -4367,7 +4367,7 @@ compile_cap_prog(synblock_T *synblock)
     regprog_T   *rp = synblock->b_cap_prog;
     char_u     *re;
 
-    if (*synblock->b_p_spc == NUL)
+    if (synblock->b_p_spc == NULL || *synblock->b_p_spc == NUL)
        synblock->b_cap_prog = NULL;
     else
     {
index a6a9439fe848d840946c564e96fc9140597e0504..3dc64cc08d9129fdb1b9fdd0706f45c143e7f7e7 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2147,
 /**/
     2146,
 /**/