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