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