]> granicus.if.org Git - vim/commitdiff
patch 8.2.1171: possible crash when out of memory v8.2.1171
authorBram Moolenaar <Bram@vim.org>
Fri, 10 Jul 2020 18:30:12 +0000 (20:30 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 10 Jul 2020 18:30:12 +0000 (20:30 +0200)
Problem:    Possible crash when out of memory.
Solution:   Check for NULL pointer. (Dominique PellĂ©, closes #6432)

src/syntax.c
src/version.c

index 6bbe4baccff1bbb3819bb8c2bf3629e50426ff5c..ccdb2030cc19dbc6d979190d9b1d8ceb9f5f860c 100644 (file)
@@ -5764,6 +5764,8 @@ syn_cmd_sync(exarg_T *eap, int syncing UNUSED)
        next_arg = skipwhite(arg_end);
        vim_free(key);
        key = vim_strnsave_up(arg_start, arg_end - arg_start);
+       if (key == NULL)
+           break;
        if (STRCMP(key, "CCOMMENT") == 0)
        {
            if (!eap->skip)
index 73d456001471e75ce54464e33d469459262b0bfc..c13f7f18f9b7f8b1be82b1ba239cc674c2704cd1 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1171,
 /**/
     1170,
 /**/