mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch: 7.4.1086 #4626
Problem: Crash with an extremely long buffer name.
Solution: Limit the return value of vim_snprintf(). (Dominique Pelle)
507edf63df
This commit is contained in:
parent
c72b60645c
commit
86eb339120
@ -2195,15 +2195,16 @@ void buflist_list(exarg_T *eap)
|
||||
len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"",
|
||||
buf->b_fnum,
|
||||
buf->b_p_bl ? ' ' : 'u',
|
||||
buf == curbuf ? '%' :
|
||||
(curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
|
||||
buf->b_ml.ml_mfp == NULL ? ' ' :
|
||||
(buf->b_nwindows == 0 ? 'h' : 'a'),
|
||||
buf == curbuf ? '%' : (curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
|
||||
buf->b_ml.ml_mfp == NULL ? ' ' : (buf->b_nwindows == 0 ? 'h' : 'a'),
|
||||
!MODIFIABLE(buf) ? '-' : (buf->b_p_ro ? '=' : ' '),
|
||||
(buf->b_flags & BF_READERR) ? 'x'
|
||||
: (bufIsChanged(buf) ? '+' : ' '),
|
||||
(buf->b_flags & BF_READERR) ? 'x' : (bufIsChanged(buf) ? '+' : ' '),
|
||||
NameBuff);
|
||||
|
||||
if (len > IOSIZE - 20) {
|
||||
len = IOSIZE - 20;
|
||||
}
|
||||
|
||||
/* put "line 999" in column 40 or after the file name */
|
||||
i = 40 - vim_strsize(IObuff);
|
||||
do {
|
||||
|
@ -592,7 +592,7 @@ static int included_patches[] = {
|
||||
1089,
|
||||
1088,
|
||||
1087,
|
||||
// 1086,
|
||||
1086,
|
||||
1085,
|
||||
1084,
|
||||
// 1083 NA
|
||||
|
Loading…
Reference in New Issue
Block a user