diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-02 15:05:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-02 15:05:05 +0200 |
commit | 8b89614e69b9b2330539d0482e44f4724053e780 (patch) | |
tree | bd5fc52f3c86d02be678746252ca12e1c863f49d /src/libvterm | |
parent | ad486a0f0dd194826fdb733516bf0f35382c9dd7 (diff) | |
download | vim-git-8b89614e69b9b2330539d0482e44f4724053e780.tar.gz |
patch 8.2.1353: crash when drawing double-wide character in terminal windowv8.2.1353
Problem: Crash when drawing double-wide character in terminal window.
(Masato Nishihata)
Solution: Check getcell() returning NULL. (issue #6141)
Diffstat (limited to 'src/libvterm')
-rw-r--r-- | src/libvterm/src/screen.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libvterm/src/screen.c b/src/libvterm/src/screen.c index eb90c2007..42890aa58 100644 --- a/src/libvterm/src/screen.c +++ b/src/libvterm/src/screen.c @@ -186,7 +186,12 @@ static int putglyph(VTermGlyphInfo *info, VTermPos pos, void *user) cell->chars[i] = 0; for(col = 1; col < info->width; col++) - getcell(screen, pos.row, pos.col + col)->chars[0] = (uint32_t)-1; + { + ScreenCell *onecell = getcell(screen, pos.row, pos.col + col); + if (onecell == NULL) + break; + onecell->chars[0] = (uint32_t)-1; + } rect.start_row = pos.row; rect.end_row = pos.row+1; |