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