summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-20 20:47:32 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-20 20:47:32 +0100
commita79fd56923744e331b3a5badbf9186100818fb45 (patch)
treeea2f0dfa4cc226159d5917f129e42bc716f4e9bb /src/terminal.c
parent6dc6703295362e0d4b81a3eceae6b0dd229b5d7e (diff)
downloadvim-git-a79fd56923744e331b3a5badbf9186100818fb45.tar.gz
patch 8.1.0611: crash when using terminal with long composing charactersv8.1.0611
Problem: Crash when using terminal with long composing characters. Solution: Make space for all characters. (Yasuhiro Matsumoto, closes #3619, closes #3703)
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 42897bf07..5a0165814 100644
--- 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;