commit | 507edf63df75fe228e0f76b845b58d60266e65d8 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sun Jan 10 20:54:17 2016 +0100 |
committer | Bram Moolenaar <Bram@vim.org> | Sun Jan 10 20:54:17 2016 +0100 |
tree | 360a0b6bdd05365981e0fbf27feb55138a21cf10 | |
parent | a52dfaed104183c1fa2a3b6e4430b23d86bcbece [diff] [blame] |
patch 7.4.1086 Problem: Crash with an extremely long buffer name. Solution: Limit the return value of vim_snprintf(). (Dominique Pelle)
diff --git a/src/buffer.c b/src/buffer.c index d1907a4..fd94a27 100644 --- a/src/buffer.c +++ b/src/buffer.c
@@ -2793,6 +2793,8 @@ (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);