]> granicus.if.org Git - vim/commitdiff
patch 8.1.0611: crash when using terminal with long composing characters v8.1.0611
authorBram Moolenaar <Bram@vim.org>
Thu, 20 Dec 2018 19:47:32 +0000 (20:47 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 20 Dec 2018 19:47:32 +0000 (20:47 +0100)
Problem:    Crash when using terminal with long composing characters.
Solution:   Make space for all characters. (Yasuhiro Matsumoto, closes #3619,
            closes #3703)

src/terminal.c
src/version.c

index 42897bf07611392828739915b727e1bd893b8a2e..5a0165814fac3529254511d41f08c1d0edbd02b0 100644 (file)
@@ -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;
index 3c194aefe8dc7480415e3fe8b2ed2190eb17e451..99513d1dcc80b188ee545ec481658c5a25b1b93e 100644 (file)
@@ -799,6 +799,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    611,
 /**/
     610,
 /**/