changeset 21240:e35955a787a8 v8.2.1171

patch 8.2.1171: possible crash when out of memory Commit: https://github.com/vim/vim/commit/58bb61cf5ee008254eb331bc3574eac87d2dcc4a Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 10 20:30:12 2020 +0200 patch 8.2.1171: possible crash when out of memory Problem: Possible crash when out of memory. Solution: Check for NULL pointer. (Dominique Pell?, closes https://github.com/vim/vim/issues/6432)
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Jul 2020 20:45:04 +0200
parents bc30efb26e7d
children c2a90975a9ed
files src/syntax.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -5764,6 +5764,8 @@ syn_cmd_sync(exarg_T *eap, int syncing U
 	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)
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1171,
+/**/
     1170,
 /**/
     1169,