Karsten Hopp f7d420
To: vim_dev@googlegroups.com
Karsten Hopp f7d420
Subject: Patch 7.4.800
Karsten Hopp f7d420
Fcc: outbox
Karsten Hopp f7d420
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f7d420
Mime-Version: 1.0
Karsten Hopp f7d420
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f7d420
Content-Transfer-Encoding: 8bit
Karsten Hopp f7d420
------------
Karsten Hopp f7d420
Karsten Hopp f7d420
Patch 7.4.800
Karsten Hopp f7d420
Problem:    Using freed memory when triggering CmdUndefined autocommands.
Karsten Hopp f7d420
Solution:   Set pointer to NULL. (Dominique Pelle)
Karsten Hopp f7d420
Files:      src/ex_docmd.c
Karsten Hopp f7d420
Karsten Hopp f7d420
Karsten Hopp f7d420
*** ../vim-7.4.799/src/ex_docmd.c	2015-07-21 15:48:13.589517950 +0200
Karsten Hopp f7d420
--- src/ex_docmd.c	2015-07-28 14:24:05.801096678 +0200
Karsten Hopp f7d420
***************
Karsten Hopp f7d420
*** 2365,2372 ****
Karsten Hopp f7d420
  	p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
Karsten Hopp f7d420
  	ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
Karsten Hopp f7d420
  	vim_free(p);
Karsten Hopp f7d420
! 	if (ret && !aborting())
Karsten Hopp f7d420
! 	    p = find_command(&ea, NULL);
Karsten Hopp f7d420
      }
Karsten Hopp f7d420
  #endif
Karsten Hopp f7d420
  
Karsten Hopp f7d420
--- 2365,2373 ----
Karsten Hopp f7d420
  	p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
Karsten Hopp f7d420
  	ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
Karsten Hopp f7d420
  	vim_free(p);
Karsten Hopp f7d420
! 	/* If the autocommands did something and didn't cause an error, try
Karsten Hopp f7d420
! 	 * finding the command again. */
Karsten Hopp f7d420
! 	p = (ret && !aborting()) ? find_command(&ea, NULL) : NULL;
Karsten Hopp f7d420
      }
Karsten Hopp f7d420
  #endif
Karsten Hopp f7d420
  
Karsten Hopp f7d420
*** ../vim-7.4.799/src/version.c	2015-07-28 13:33:36.850531694 +0200
Karsten Hopp f7d420
--- src/version.c	2015-07-28 14:22:09.050246179 +0200
Karsten Hopp f7d420
***************
Karsten Hopp f7d420
*** 743,744 ****
Karsten Hopp f7d420
--- 743,746 ----
Karsten Hopp f7d420
  {   /* Add new patch number below this line */
Karsten Hopp f7d420
+ /**/
Karsten Hopp f7d420
+     800,
Karsten Hopp f7d420
  /**/
Karsten Hopp f7d420
Karsten Hopp f7d420
-- 
Karsten Hopp f7d420
   They now pass three KNIGHTS impaled to a tree.  With their feet off the
Karsten Hopp f7d420
   ground,  with one lance through the lot of them, they are skewered up
Karsten Hopp f7d420
   like a barbecue.
Karsten Hopp f7d420
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp f7d420
Karsten Hopp f7d420
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f7d420
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f7d420
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f7d420
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///