aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorDavid Bürgin <676c7473@gmail.com>2015-05-03 17:03:39 +0200
committerJustin M. Keyes <justinkz@gmail.com>2015-05-16 23:46:29 -0400
commit7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9 (patch)
treec7464ee01b14ffae68be9866e4be1a87d68dc98f /src/nvim/buffer.c
parentf52528477886556e4fc0fa80b6a9d0b8d08cfd9d (diff)
downloadrneovim-7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9.tar.gz
rneovim-7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9.tar.bz2
rneovim-7a7d082e125352a76f54d7fbe5fc67e9cddaf7c9.zip
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
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index fd55e8c7a0..b4b36f7fc0 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3511,6 +3511,11 @@ build_stl_str_hl (
*/
void get_rel_pos(win_T *wp, char_u *buf, int buflen)
{
+ // Need at least 3 chars for writing.
+ if (buflen < 3) {
+ return;
+ }
+
long above; /* number of lines above window */
long below; /* number of lines below window */