Blob Blame History Raw
To: vim-dev@vim.org
Subject: patch 7.1.053
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.1.053
Problem:    Accessing uninitialized memory when giving a message.
Solution:   Check going the length before checking for a NUL byte.
Files:	    src/message.c


*** ../vim-7.1.052/src/message.c	Thu Jul  5 10:10:29 2007
--- src/message.c	Sat Aug  4 23:13:58 2007
***************
*** 1842,1848 ****
      int		wrap;
  
      did_wait_return = FALSE;
!     while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
      {
  	/*
  	 * We are at the end of the screen line when:
--- 1842,1848 ----
      int		wrap;
  
      did_wait_return = FALSE;
!     while ((maxlen < 0 || (int)(s - str) < maxlen) && *s != NUL)
      {
  	/*
  	 * We are at the end of the screen line when:
*** ../vim-7.1.052/src/version.c	Sun Aug  5 18:49:07 2007
--- src/version.c	Sun Aug  5 19:18:46 2007
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     53,
  /**/

-- 
From "know your smileys":
 <>:-)	Bishop

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///