Karsten Hopp a41551
To: vim_dev@googlegroups.com
Karsten Hopp a41551
Subject: Patch 7.3.166
Karsten Hopp a41551
Fcc: outbox
Karsten Hopp a41551
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp a41551
Mime-Version: 1.0
Karsten Hopp a41551
Content-Type: text/plain; charset=UTF-8
Karsten Hopp a41551
Content-Transfer-Encoding: 8bit
Karsten Hopp a41551
------------
Karsten Hopp a41551
Karsten Hopp a41551
Patch 7.3.166
Karsten Hopp a41551
Problem:    Buffer on the stack may be too big
Karsten Hopp a41551
Solution:   Allocate the space.
Karsten Hopp a41551
Files:	    src/option.c
Karsten Hopp a41551
Karsten Hopp a41551
Karsten Hopp a41551
*** ../vim-7.3.165/src/option.c	2011-04-28 12:56:57.000000000 +0200
Karsten Hopp a41551
--- src/option.c	2011-04-15 20:49:54.000000000 +0200
Karsten Hopp a41551
***************
Karsten Hopp a41551
*** 9185,9191 ****
Karsten Hopp a41551
      int		expand;
Karsten Hopp a41551
  {
Karsten Hopp a41551
      char_u	*s;
Karsten Hopp a41551
!     char_u	buf[MAXPATHL];
Karsten Hopp a41551
  
Karsten Hopp a41551
      if (fprintf(fd, "%s %s=", cmd, name) < 0)
Karsten Hopp a41551
  	return FAIL;
Karsten Hopp a41551
--- 9185,9191 ----
Karsten Hopp a41551
      int		expand;
Karsten Hopp a41551
  {
Karsten Hopp a41551
      char_u	*s;
Karsten Hopp a41551
!     char_u	*buf;
Karsten Hopp a41551
  
Karsten Hopp a41551
      if (fprintf(fd, "%s %s=", cmd, name) < 0)
Karsten Hopp a41551
  	return FAIL;
Karsten Hopp a41551
***************
Karsten Hopp a41551
*** 9203,9211 ****
Karsten Hopp a41551
--- 9203,9218 ----
Karsten Hopp a41551
  	}
Karsten Hopp a41551
  	else if (expand)
Karsten Hopp a41551
  	{
Karsten Hopp a41551
+ 	    buf = alloc(MAXPATHL);
Karsten Hopp a41551
+ 	    if (buf == NULL)
Karsten Hopp a41551
+ 		return FAIL;
Karsten Hopp a41551
  	    home_replace(NULL, *valuep, buf, MAXPATHL, FALSE);
Karsten Hopp a41551
  	    if (put_escstr(fd, buf, 2) == FAIL)
Karsten Hopp a41551
+ 	    {
Karsten Hopp a41551
+ 		vim_free(buf);
Karsten Hopp a41551
  		return FAIL;
Karsten Hopp a41551
+ 	    }
Karsten Hopp a41551
+ 	    vim_free(buf);
Karsten Hopp a41551
  	}
Karsten Hopp a41551
  	else if (put_escstr(fd, *valuep, 2) == FAIL)
Karsten Hopp a41551
  	    return FAIL;
Karsten Hopp a41551
*** ../vim-7.3.165/src/version.c	2011-04-28 17:21:49.000000000 +0200
Karsten Hopp a41551
--- src/version.c	2011-04-28 17:23:24.000000000 +0200
Karsten Hopp a41551
***************
Karsten Hopp a41551
*** 716,717 ****
Karsten Hopp a41551
--- 716,719 ----
Karsten Hopp a41551
  {   /* Add new patch number below this line */
Karsten Hopp a41551
+ /**/
Karsten Hopp a41551
+     166,
Karsten Hopp a41551
  /**/
Karsten Hopp a41551
Karsten Hopp a41551
-- 
Karsten Hopp a41551
He who laughs last, thinks slowest.
Karsten Hopp a41551
Karsten Hopp a41551
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp a41551
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp a41551
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp a41551
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///