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