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
This commit is contained in:
David Bürgin
2015-05-03 17:03:39 +02:00
committed by Justin M. Keyes
parent f525284778
commit 7a7d082e12
3 changed files with 8 additions and 2 deletions

View File

@@ -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