changeset 7572:992fe73d4ee6 v7.4.1086

commit https://github.com/vim/vim/commit/507edf63df75fe228e0f76b845b58d60266e65d8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 20:54:17 2016 +0100 patch 7.4.1086 Problem: Crash with an extremely long buffer name. Solution: Limit the return value of vim_snprintf(). (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jan 2016 21:00:04 +0100
parents 626c631e029f
children 4c8a7f265023
files src/buffer.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2793,6 +2793,8 @@ buflist_list(eap)
 		(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);
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1086,
+/**/
     1085,
 /**/
     1084,