Karsten Hopp 6b729c
To: vim_dev@googlegroups.com
Karsten Hopp 6b729c
Subject: Patch 7.3.371
Karsten Hopp 6b729c
Fcc: outbox
Karsten Hopp 6b729c
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6b729c
Mime-Version: 1.0
Karsten Hopp 6b729c
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6b729c
Content-Transfer-Encoding: 8bit
Karsten Hopp 6b729c
------------
Karsten Hopp 6b729c
Karsten Hopp 6b729c
Patch 7.3.371
Karsten Hopp 6b729c
Problem:    Crash in autocomplete. (Greg Weber)
Karsten Hopp 6b729c
Solution:   Check not going over allocated buffer size.
Karsten Hopp 6b729c
Files:	    src/misc2.c
Karsten Hopp 6b729c
Karsten Hopp 6b729c
Karsten Hopp 6b729c
*** ../vim-7.3.370/src/misc2.c	2011-10-26 11:40:56.000000000 +0200
Karsten Hopp 6b729c
--- src/misc2.c	2011-12-08 17:49:23.000000000 +0100
Karsten Hopp 6b729c
***************
Karsten Hopp 6b729c
*** 4293,4298 ****
Karsten Hopp 6b729c
--- 4293,4300 ----
Karsten Hopp 6b729c
  static int ff_path_in_stoplist __ARGS((char_u *, int, char_u **));
Karsten Hopp 6b729c
  #endif
Karsten Hopp 6b729c
  
Karsten Hopp 6b729c
+ static char_u e_pathtoolong[] = N_("E854: path too long for completion");
Karsten Hopp 6b729c
+ 
Karsten Hopp 6b729c
  #if 0
Karsten Hopp 6b729c
  /*
Karsten Hopp 6b729c
   * if someone likes findfirst/findnext, here are the functions
Karsten Hopp 6b729c
***************
Karsten Hopp 6b729c
*** 4589,4594 ****
Karsten Hopp 6b729c
--- 4591,4601 ----
Karsten Hopp 6b729c
  	len = 0;
Karsten Hopp 6b729c
  	while (*wc_part != NUL)
Karsten Hopp 6b729c
  	{
Karsten Hopp 6b729c
+ 	    if (len + 5 >= MAXPATHL)
Karsten Hopp 6b729c
+ 	    {
Karsten Hopp 6b729c
+ 		EMSG(_(e_pathtoolong));
Karsten Hopp 6b729c
+ 		break;
Karsten Hopp 6b729c
+ 	    }
Karsten Hopp 6b729c
  	    if (STRNCMP(wc_part, "**", 2) == 0)
Karsten Hopp 6b729c
  	    {
Karsten Hopp 6b729c
  		ff_expand_buffer[len++] = *wc_part++;
Karsten Hopp 6b729c
***************
Karsten Hopp 6b729c
*** 4634,4639 ****
Karsten Hopp 6b729c
--- 4641,4652 ----
Karsten Hopp 6b729c
      }
Karsten Hopp 6b729c
  
Karsten Hopp 6b729c
      /* create an absolute path */
Karsten Hopp 6b729c
+     if (STRLEN(search_ctx->ffsc_start_dir)
Karsten Hopp 6b729c
+ 			  + STRLEN(search_ctx->ffsc_fix_path) + 3 >= MAXPATHL)
Karsten Hopp 6b729c
+     {
Karsten Hopp 6b729c
+ 	EMSG(_(e_pathtoolong));
Karsten Hopp 6b729c
+ 	goto error_return;
Karsten Hopp 6b729c
+     }
Karsten Hopp 6b729c
      STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
Karsten Hopp 6b729c
      add_pathsep(ff_expand_buffer);
Karsten Hopp 6b729c
      STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
Karsten Hopp 6b729c
*** ../vim-7.3.370/src/version.c	2011-12-08 16:00:12.000000000 +0100
Karsten Hopp 6b729c
--- src/version.c	2011-12-08 17:46:41.000000000 +0100
Karsten Hopp 6b729c
***************
Karsten Hopp 6b729c
*** 716,717 ****
Karsten Hopp 6b729c
--- 716,719 ----
Karsten Hopp 6b729c
  {   /* Add new patch number below this line */
Karsten Hopp 6b729c
+ /**/
Karsten Hopp 6b729c
+     371,
Karsten Hopp 6b729c
  /**/
Karsten Hopp 6b729c
Karsten Hopp 6b729c
-- 
Karsten Hopp 6b729c
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 6b729c
253. You wait for a slow loading web page before going to the toilet.
Karsten Hopp 6b729c
Karsten Hopp 6b729c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6b729c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6b729c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 6b729c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///