lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
e99f3da
To: vim_dev@googlegroups.com
e99f3da
Subject: Patch 7.3.112
e99f3da
Fcc: outbox
e99f3da
From: Bram Moolenaar <Bram@moolenaar.net>
e99f3da
Mime-Version: 1.0
e99f3da
Content-Type: text/plain; charset=UTF-8
e99f3da
Content-Transfer-Encoding: 8bit
e99f3da
------------
e99f3da
e99f3da
Patch 7.3.112
e99f3da
Problem:    Setting 'statusline' to "%!'asdf%' reads uninitialized memory.
e99f3da
Solution:   Check for NUL after %.
e99f3da
Files:	    src/buffer.c
e99f3da
e99f3da
e99f3da
*** ../vim-7.3.111/src/buffer.c	2010-10-27 16:17:56.000000000 +0200
e99f3da
--- src/buffer.c	2011-02-01 21:40:17.000000000 +0100
e99f3da
***************
e99f3da
*** 3364,3370 ****
e99f3da
   * or truncated if too long, fillchar is used for all whitespace.
e99f3da
   */
e99f3da
      int
e99f3da
! build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, tabtab)
e99f3da
      win_T	*wp;
e99f3da
      char_u	*out;		/* buffer to write into != NameBuff */
e99f3da
      size_t	outlen;		/* length of out[] */
e99f3da
--- 3364,3371 ----
e99f3da
   * or truncated if too long, fillchar is used for all whitespace.
e99f3da
   */
e99f3da
      int
e99f3da
! build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar,
e99f3da
! 						      maxwidth, hltab, tabtab)
e99f3da
      win_T	*wp;
e99f3da
      char_u	*out;		/* buffer to write into != NameBuff */
e99f3da
      size_t	outlen;		/* length of out[] */
e99f3da
***************
e99f3da
*** 3474,3479 ****
e99f3da
--- 3475,3482 ----
e99f3da
  	 * Handle one '%' item.
e99f3da
  	 */
e99f3da
  	s++;
e99f3da
+ 	if (*s == NUL)  /* ignore trailing % */
e99f3da
+ 	    break;
e99f3da
  	if (*s == '%')
e99f3da
  	{
e99f3da
  	    if (p + 1 >= out + outlen)
e99f3da
*** ../vim-7.3.111/src/version.c	2011-02-01 18:01:06.000000000 +0100
e99f3da
--- src/version.c	2011-02-01 21:54:01.000000000 +0100
e99f3da
***************
e99f3da
*** 716,717 ****
e99f3da
--- 716,719 ----
e99f3da
  {   /* Add new patch number below this line */
e99f3da
+ /**/
e99f3da
+     112,
e99f3da
  /**/
e99f3da
e99f3da
-- 
e99f3da
Rule #1: Don't give somebody a tool that he's going to hurt himself with.
e99f3da
e99f3da
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
e99f3da
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
e99f3da
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
e99f3da
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///