073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.562
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.562
073263
Problem:    Segfault with wide screen and error in 'rulerformat'. (Ingo Karkat)
073263
Solution:   Check there is enough space. (Christian Brabandt)
073263
Files:	    src/buffer.c, src/screen.c
073263
073263
073263
*** ../vim-7.4.561/src/buffer.c	2014-11-19 16:38:01.500680103 +0100
073263
--- src/buffer.c	2015-01-07 13:24:22.663808167 +0100
073263
***************
073263
*** 4409,4414 ****
073263
--- 4409,4416 ----
073263
      long	above; /* number of lines above window */
073263
      long	below; /* number of lines below window */
073263
  
073263
+     if (buflen < 3) /* need at least 3 chars for writing */
073263
+ 	return;
073263
      above = wp->w_topline - 1;
073263
  #ifdef FEAT_DIFF
073263
      above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill;
073263
*** ../vim-7.4.561/src/screen.c	2014-12-13 03:36:34.988435244 +0100
073263
--- src/screen.c	2015-01-07 13:28:04.069254599 +0100
073263
***************
073263
*** 10588,10594 ****
073263
  	    this_ru_col = (WITH_WIDTH(width) + 1) / 2;
073263
  	if (this_ru_col + o < WITH_WIDTH(width))
073263
  	{
073263
! 	    while (this_ru_col + o < WITH_WIDTH(width))
073263
  	    {
073263
  #ifdef FEAT_MBYTE
073263
  		if (has_mbyte)
073263
--- 10588,10595 ----
073263
  	    this_ru_col = (WITH_WIDTH(width) + 1) / 2;
073263
  	if (this_ru_col + o < WITH_WIDTH(width))
073263
  	{
073263
! 	    /* need at least 3 chars left for get_rel_pos() + NUL */
073263
! 	    while (this_ru_col + o < WITH_WIDTH(width) && RULER_BUF_LEN > i + 4)
073263
  	    {
073263
  #ifdef FEAT_MBYTE
073263
  		if (has_mbyte)
073263
*** ../vim-7.4.561/src/version.c	2015-01-07 13:15:40.609829496 +0100
073263
--- src/version.c	2015-01-07 13:22:59.184770984 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     562,
073263
  /**/
073263
073263
-- 
073263
"I can't complain, but sometimes I still do."   (Joe Walsh)
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///