changeset 15203:aa877e0b7f62 v8.1.0611

patch 8.1.0611: crash when using terminal with long composing characters commit https://github.com/vim/vim/commit/a79fd56923744e331b3a5badbf9186100818fb45 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 20 20:47:32 2018 +0100 patch 8.1.0611: crash when using terminal with long composing characters Problem: Crash when using terminal with long composing characters. Solution: Make space for all characters. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/3619, closes #3703)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Dec 2018 21:00:07 +0100
parents 9321e405a8fa
children e4d63834f866
files src/terminal.c src/version.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1561,7 +1561,8 @@ update_snapshot(term_T *term)
 
 			cell2cellattr(&cell, &p[pos.col]);
 
-			if (ga_grow(&ga, MB_MAXBYTES) == OK)
+			// Each character can be up to 6 bytes.
+			if (ga_grow(&ga, VTERM_MAX_CHARS_PER_CELL * 6) == OK)
 			{
 			    int	    i;
 			    int	    c;
--- a/src/version.c
+++ b/src/version.c
@@ -800,6 +800,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    611,
+/**/
     610,
 /**/
     609,