99b86a7
To: vim-dev@vim.org
99b86a7
Subject: Patch 7.1.173
99b86a7
Fcc: outbox
99b86a7
From: Bram Moolenaar <Bram@moolenaar.net>
99b86a7
Mime-Version: 1.0
99b86a7
Content-Type: text/plain; charset=ISO-8859-1
99b86a7
Content-Transfer-Encoding: 8bit
99b86a7
------------
99b86a7
99b86a7
Patch 7.1.173
99b86a7
Problem:    Accessing freed memory. (Dominique Pelle)
99b86a7
Solution:   Don't call reg_getline() to check if a line is the first in the
99b86a7
	    file.
99b86a7
Files:	    src/regexp.c
99b86a7
99b86a7
99b86a7
*** ../vim-7.1.172/src/regexp.c	Thu Nov 29 21:26:38 2007
99b86a7
--- src/regexp.c	Sat Dec  8 15:54:05 2007
99b86a7
***************
99b86a7
*** 3810,3820 ****
99b86a7
  	    break;
99b86a7
  
99b86a7
  	  case RE_BOF:
99b86a7
! 	    /* Passing -1 to the getline() function provided for the search
99b86a7
! 	     * should always return NULL if the current line is the first
99b86a7
! 	     * line of the file. */
99b86a7
  	    if (reglnum != 0 || reginput != regline
99b86a7
! 			|| (REG_MULTI && reg_getline((linenr_T)-1) != NULL))
99b86a7
  		status = RA_NOMATCH;
99b86a7
  	    break;
99b86a7
  
99b86a7
--- 3810,3820 ----
99b86a7
  	    break;
99b86a7
  
99b86a7
  	  case RE_BOF:
99b86a7
! 	    /* We're not at the beginning of the file when below the first
99b86a7
! 	     * line where we started, not at the start of the line or we
99b86a7
! 	     * didn't start at the first line of the buffer. */
99b86a7
  	    if (reglnum != 0 || reginput != regline
99b86a7
! 					  || (REG_MULTI && reg_firstlnum > 1))
99b86a7
  		status = RA_NOMATCH;
99b86a7
  	    break;
99b86a7
  
99b86a7
*** ../vim-7.1.172/src/version.c	Sat Dec  8 22:20:24 2007
99b86a7
--- src/version.c	Sun Dec  9 19:24:36 2007
99b86a7
***************
99b86a7
*** 668,669 ****
99b86a7
--- 668,671 ----
99b86a7
  {   /* Add new patch number below this line */
99b86a7
+ /**/
99b86a7
+     173,
99b86a7
  /**/
99b86a7
99b86a7
-- 
99b86a7
hundred-and-one symptoms of being an internet addict:
99b86a7
213. Your kids start referring to you as "that guy in front of the monitor."
99b86a7
99b86a7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
99b86a7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
99b86a7
\\\        download, build and distribute -- http://www.A-A-P.org        ///
99b86a7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///