Skip to content

Commit 507edf6

Browse files
committed
patch 7.4.1086
Problem: Crash with an extremely long buffer name. Solution: Limit the return value of vim_snprintf(). (Dominique Pelle)
1 parent a52dfae commit 507edf6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,6 +2793,8 @@ buflist_list(eap)
27932793
(buf->b_flags & BF_READERR) ? 'x'
27942794
: (bufIsChanged(buf) ? '+' : ' '),
27952795
NameBuff);
2796+
if (len > IOSIZE - 20)
2797+
len = IOSIZE - 20;
27962798

27972799
/* put "line 999" in column 40 or after the file name */
27982800
i = 40 - vim_strsize(IObuff);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1086,
744746
/**/
745747
1085,
746748
/**/

0 commit comments

Comments
 (0)