Karsten Hopp 4cf32d
To: vim_dev@googlegroups.com
Karsten Hopp 4cf32d
Subject: Patch 7.3.522
Karsten Hopp 4cf32d
Fcc: outbox
Karsten Hopp 4cf32d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4cf32d
Mime-Version: 1.0
Karsten Hopp 4cf32d
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 4cf32d
Content-Transfer-Encoding: 8bit
Karsten Hopp 4cf32d
------------
Karsten Hopp 4cf32d
Karsten Hopp 4cf32d
Patch 7.3.522
Karsten Hopp 4cf32d
Problem:    Crash in vim_realloc() when using MEM_PROFILE.
Karsten Hopp 4cf32d
Solution:   Avoid using a NULL argument. (Dominique Pelle)
Karsten Hopp 4cf32d
Files:	    src/eval.c
Karsten Hopp 4cf32d
Karsten Hopp 4cf32d
Karsten Hopp 4cf32d
*** ../vim-7.3.521/src/eval.c	2012-05-18 12:06:58.000000000 +0200
Karsten Hopp 4cf32d
--- src/eval.c	2012-05-18 18:19:25.000000000 +0200
Karsten Hopp 4cf32d
***************
Karsten Hopp 4cf32d
*** 14643,14649 ****
Karsten Hopp 4cf32d
  		    long growmin  = (long)((p - start) * 2 + prevlen);
Karsten Hopp 4cf32d
  		    prevsize = grow50pc > growmin ? grow50pc : growmin;
Karsten Hopp 4cf32d
  		}
Karsten Hopp 4cf32d
! 		if ((newprev = vim_realloc(prev, prevsize)) == NULL)
Karsten Hopp 4cf32d
  		{
Karsten Hopp 4cf32d
  		    do_outofmem_msg((long_u)prevsize);
Karsten Hopp 4cf32d
  		    failed = TRUE;
Karsten Hopp 4cf32d
--- 14643,14651 ----
Karsten Hopp 4cf32d
  		    long growmin  = (long)((p - start) * 2 + prevlen);
Karsten Hopp 4cf32d
  		    prevsize = grow50pc > growmin ? grow50pc : growmin;
Karsten Hopp 4cf32d
  		}
Karsten Hopp 4cf32d
! 		newprev = prev == NULL ? alloc(prevsize)
Karsten Hopp 4cf32d
! 						: vim_realloc(prev, prevsize);
Karsten Hopp 4cf32d
! 		if (newprev == NULL)
Karsten Hopp 4cf32d
  		{
Karsten Hopp 4cf32d
  		    do_outofmem_msg((long_u)prevsize);
Karsten Hopp 4cf32d
  		    failed = TRUE;
Karsten Hopp 4cf32d
*** ../vim-7.3.521/src/version.c	2012-05-18 18:07:57.000000000 +0200
Karsten Hopp 4cf32d
--- src/version.c	2012-05-18 18:33:36.000000000 +0200
Karsten Hopp 4cf32d
***************
Karsten Hopp 4cf32d
*** 716,717 ****
Karsten Hopp 4cf32d
--- 716,719 ----
Karsten Hopp 4cf32d
  {   /* Add new patch number below this line */
Karsten Hopp 4cf32d
+ /**/
Karsten Hopp 4cf32d
+     522,
Karsten Hopp 4cf32d
  /**/
Karsten Hopp 4cf32d
Karsten Hopp 4cf32d
-- 
Karsten Hopp 4cf32d
ARTHUR:    ... and I am your king ....
Karsten Hopp 4cf32d
OLD WOMAN: Ooooh!  I didn't know we had a king.  I thought we were an
Karsten Hopp 4cf32d
           autonomous collective ...
Karsten Hopp 4cf32d
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 4cf32d
Karsten Hopp 4cf32d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4cf32d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4cf32d
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 4cf32d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///