diff options
author | David Bürgin <676c7473@gmail.com> | 2015-05-03 17:03:39 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-05-16 23:46:29 -0400 |
commit | 7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9 (patch) | |
tree | c7464ee01b14ffae68be9866e4be1a87d68dc98f /src/nvim/screen.c | |
parent | f52528477886556e4fc0fa80b6a9d0b8d08cfd9d (diff) | |
download | rneovim-7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9.tar.gz rneovim-7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9.tar.bz2 rneovim-7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9.zip |
vim-patch:7.4.562 #2593
Problem: Segfault with wide screen and error in 'rulerformat'. (Ingo Karkat)
Solution: Check there is enough space. (Christian Brabandt)
https://github.com/vim/vim/commit/v7-4-562
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 6e3a4932a8..8b47d090d4 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -7106,7 +7106,8 @@ static void win_redr_ruler(win_T *wp, int always) if (this_ru_col < (width + 1) / 2) this_ru_col = (width + 1) / 2; if (this_ru_col + o < width) { - while (this_ru_col + o < width) { + // Need at least 3 chars left for get_rel_pos() + NUL. + while (this_ru_col + o < width && RULER_BUF_LEN > i + 4) { if (has_mbyte) i += (*mb_char2bytes)(fillchar, buffer + i); else |