3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.402
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.402
3ef2ca
Problem:    Test 72 crashes under certain conditions. (Kazunobu Kuriyama)
3ef2ca
Solution:   Clear the whole bufinfo_T early.
3ef2ca
Files:	    src/undo.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.401/src/undo.c	2014-08-10 13:34:59.064785459 +0200
3ef2ca
--- src/undo.c	2014-08-12 20:08:23.915373819 +0200
3ef2ca
***************
3ef2ca
*** 929,935 ****
3ef2ca
  undo_flush(bi)
3ef2ca
      bufinfo_T	*bi;
3ef2ca
  {
3ef2ca
!     if (bi->bi_used > 0)
3ef2ca
      {
3ef2ca
  	crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
3ef2ca
  	if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
3ef2ca
--- 929,935 ----
3ef2ca
  undo_flush(bi)
3ef2ca
      bufinfo_T	*bi;
3ef2ca
  {
3ef2ca
!     if (bi->bi_buffer != NULL && bi->bi_used > 0)
3ef2ca
      {
3ef2ca
  	crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
3ef2ca
  	if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
3ef2ca
***************
3ef2ca
*** 1573,1582 ****
3ef2ca
  #endif
3ef2ca
      bufinfo_T	bi;
3ef2ca
  
3ef2ca
! #ifdef FEAT_CRYPT
3ef2ca
!     bi.bi_state = NULL;
3ef2ca
!     bi.bi_buffer = NULL;
3ef2ca
! #endif
3ef2ca
  
3ef2ca
      if (name == NULL)
3ef2ca
      {
3ef2ca
--- 1573,1579 ----
3ef2ca
  #endif
3ef2ca
      bufinfo_T	bi;
3ef2ca
  
3ef2ca
!     vim_memset(&bi, 0, sizeof(bi));
3ef2ca
  
3ef2ca
      if (name == NULL)
3ef2ca
      {
3ef2ca
***************
3ef2ca
*** 1861,1866 ****
3ef2ca
--- 1858,1864 ----
3ef2ca
  #endif
3ef2ca
      bufinfo_T	bi;
3ef2ca
  
3ef2ca
+     vim_memset(&bi, 0, sizeof(bi));
3ef2ca
      if (name == NULL)
3ef2ca
      {
3ef2ca
  	file_name = u_get_undo_file_name(curbuf->b_ffname, TRUE);
3ef2ca
***************
3ef2ca
*** 1905,1914 ****
3ef2ca
      }
3ef2ca
      bi.bi_buf = curbuf;
3ef2ca
      bi.bi_fp = fp;
3ef2ca
- #ifdef FEAT_CRYPT
3ef2ca
-     bi.bi_state = NULL;
3ef2ca
-     bi.bi_buffer = NULL;
3ef2ca
- #endif
3ef2ca
  
3ef2ca
      /*
3ef2ca
       * Read the undo file header.
3ef2ca
--- 1903,1908 ----
3ef2ca
*** ../vim-7.4.401/src/version.c	2014-08-10 16:31:47.376709213 +0200
3ef2ca
--- src/version.c	2014-08-12 20:11:13.879372598 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     402,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
Far back in the mists of ancient time, in the great and glorious days of the
3ef2ca
former Galactic Empire, life was wild, rich and largely tax free.
3ef2ca
Mighty starships plied their way between exotic suns, seeking adventure and
3ef2ca
reward among the furthest reaches of Galactic space.  In those days, spirits
3ef2ca
were brave, the stakes were high, men were real men, women were real women
3ef2ca
and small furry creatures from Alpha Centauri were real small furry creatures
3ef2ca
from Alpha Centauri.  And all dared to brave unknown terrors, to do mighty
3ef2ca
deeds, to boldly split infinitives that no man had split before -- and thus
3ef2ca
was the Empire forged.
3ef2ca
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///