changeset 18305:f4db8631d9c5 v8.1.2147

patch 8.1.2147: crash when allocating memory fails Commit: https://github.com/vim/vim/commit/53efb18530cc3940d7af2ea338947783ea5495ed Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 13 19:49:26 2019 +0200 patch 8.1.2147: crash when allocating memory fails Problem: Crash when allocating memory fails. (Zu-Ming Jiang) Solution: Check that 'spellcapcheck' is not NULL. (closes https://github.com/vim/vim/issues/5048)
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Oct 2019 20:00:04 +0200
parents 0df82ef32974
children 9307e77908be
files src/spell.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/spell.c
+++ b/src/spell.c
@@ -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
     {
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2147,
+/**/
     2146,
 /**/
     2145,