astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
c3617d3
To: vim-dev@vim.org
c3617d3
Subject: Patch 7.1.330
c3617d3
Fcc: outbox
c3617d3
From: Bram Moolenaar <Bram@moolenaar.net>
c3617d3
Mime-Version: 1.0
c3617d3
Content-Type: text/plain; charset=ISO-8859-1
c3617d3
Content-Transfer-Encoding: 8bit
c3617d3
------------
c3617d3
c3617d3
Patch 7.1.330
c3617d3
Problem:    Reading uninitialized memory when using Del in replace mode.
c3617d3
Solution:   Use utfc_ptr2len_len() instead of mb_ptr2len(). (Dominique Pelle)
c3617d3
Files:	    src/misc1.c
c3617d3
c3617d3
c3617d3
*** ../vim-7.1.329/src/misc1.c	Mon Feb 25 21:54:23 2008
c3617d3
--- src/misc1.c	Sat Jun 21 16:02:34 2008
c3617d3
***************
c3617d3
*** 1880,1894 ****
c3617d3
  # ifdef FEAT_MBYTE
c3617d3
      int		n;
c3617d3
  
c3617d3
!     for (i = 0; i < len; i += n)
c3617d3
!     {
c3617d3
! 	n = (*mb_ptr2len)(p + i);
c3617d3
! 	ins_char_bytes(p + i, n);
c3617d3
!     }
c3617d3
! # else
c3617d3
!     for (i = 0; i < len; ++i)
c3617d3
! 	ins_char(p[i]);
c3617d3
  # endif
c3617d3
  }
c3617d3
  #endif
c3617d3
  
c3617d3
--- 1880,1899 ----
c3617d3
  # ifdef FEAT_MBYTE
c3617d3
      int		n;
c3617d3
  
c3617d3
!     if (has_mbyte)
c3617d3
! 	for (i = 0; i < len; i += n)
c3617d3
! 	{
c3617d3
! 	    if (enc_utf8)
c3617d3
! 		/* avoid reading past p[len] */
c3617d3
! 		n = utfc_ptr2len_len(p + i, len - i);
c3617d3
! 	    else
c3617d3
! 		n = (*mb_ptr2len)(p + i);
c3617d3
! 	    ins_char_bytes(p + i, n);
c3617d3
! 	}
c3617d3
!     else
c3617d3
  # endif
c3617d3
+ 	for (i = 0; i < len; ++i)
c3617d3
+ 	    ins_char(p[i]);
c3617d3
  }
c3617d3
  #endif
c3617d3
  
c3617d3
*** ../vim-7.1.329/src/version.c	Sat Jun 21 14:13:51 2008
c3617d3
--- src/version.c	Sat Jun 21 16:28:28 2008
c3617d3
***************
c3617d3
*** 668,669 ****
c3617d3
--- 673,676 ----
c3617d3
  {   /* Add new patch number below this line */
c3617d3
+ /**/
c3617d3
+     330,
c3617d3
  /**/
c3617d3
c3617d3
-- 
c3617d3
hundred-and-one symptoms of being an internet addict:
c3617d3
65. The last time you looked at the clock it was 11:30pm, and in what
c3617d3
    seems like only a few seconds later, your sister runs past you to
c3617d3
    catch her 7am school bus.
c3617d3
c3617d3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
c3617d3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
c3617d3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
c3617d3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///