Karsten Hopp cc5be8
To: vim_dev@googlegroups.com
Karsten Hopp cc5be8
Subject: Patch 7.4.102
Karsten Hopp cc5be8
Fcc: outbox
Karsten Hopp cc5be8
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp cc5be8
Mime-Version: 1.0
Karsten Hopp cc5be8
Content-Type: text/plain; charset=UTF-8
Karsten Hopp cc5be8
Content-Transfer-Encoding: 8bit
Karsten Hopp cc5be8
------------
Karsten Hopp cc5be8
Karsten Hopp cc5be8
Patch 7.4.102
Karsten Hopp cc5be8
Problem:    Crash when interrupting "z=".
Karsten Hopp cc5be8
Solution:   Add safety check for word length. (Christian Brabandt, Dominique
Karsten Hopp cc5be8
	    Pelle)
Karsten Hopp cc5be8
Files:	    src/spell.c
Karsten Hopp cc5be8
Karsten Hopp cc5be8
Karsten Hopp cc5be8
*** ../vim-7.4.101/src/spell.c	2013-11-14 03:54:02.000000000 +0100
Karsten Hopp cc5be8
--- src/spell.c	2013-11-21 17:37:04.000000000 +0100
Karsten Hopp cc5be8
***************
Karsten Hopp cc5be8
*** 13398,13406 ****
Karsten Hopp cc5be8
  
Karsten Hopp cc5be8
  	/* Lookup the word "orgnr" one of the two tries. */
Karsten Hopp cc5be8
  	n = 0;
Karsten Hopp cc5be8
- 	wlen = 0;
Karsten Hopp cc5be8
  	wordcount = 0;
Karsten Hopp cc5be8
! 	for (;;)
Karsten Hopp cc5be8
  	{
Karsten Hopp cc5be8
  	    i = 1;
Karsten Hopp cc5be8
  	    if (wordcount == orgnr && byts[n + 1] == NUL)
Karsten Hopp cc5be8
--- 13398,13405 ----
Karsten Hopp cc5be8
  
Karsten Hopp cc5be8
  	/* Lookup the word "orgnr" one of the two tries. */
Karsten Hopp cc5be8
  	n = 0;
Karsten Hopp cc5be8
  	wordcount = 0;
Karsten Hopp cc5be8
! 	for (wlen = 0; wlen < MAXWLEN - 3; ++wlen)
Karsten Hopp cc5be8
  	{
Karsten Hopp cc5be8
  	    i = 1;
Karsten Hopp cc5be8
  	    if (wordcount == orgnr && byts[n + 1] == NUL)
Karsten Hopp cc5be8
***************
Karsten Hopp cc5be8
*** 13414,13419 ****
Karsten Hopp cc5be8
--- 13413,13419 ----
Karsten Hopp cc5be8
  		if (i > byts[n])	/* safety check */
Karsten Hopp cc5be8
  		{
Karsten Hopp cc5be8
  		    STRCPY(theword + wlen, "BAD");
Karsten Hopp cc5be8
+ 		    wlen += 3;
Karsten Hopp cc5be8
  		    goto badword;
Karsten Hopp cc5be8
  		}
Karsten Hopp cc5be8
  
Karsten Hopp cc5be8
***************
Karsten Hopp cc5be8
*** 13426,13432 ****
Karsten Hopp cc5be8
  		wordcount += wc;
Karsten Hopp cc5be8
  	    }
Karsten Hopp cc5be8
  
Karsten Hopp cc5be8
! 	    theword[wlen++] = byts[n + i];
Karsten Hopp cc5be8
  	    n = idxs[n + i];
Karsten Hopp cc5be8
  	}
Karsten Hopp cc5be8
  badword:
Karsten Hopp cc5be8
--- 13426,13432 ----
Karsten Hopp cc5be8
  		wordcount += wc;
Karsten Hopp cc5be8
  	    }
Karsten Hopp cc5be8
  
Karsten Hopp cc5be8
! 	    theword[wlen] = byts[n + i];
Karsten Hopp cc5be8
  	    n = idxs[n + i];
Karsten Hopp cc5be8
  	}
Karsten Hopp cc5be8
  badword:
Karsten Hopp cc5be8
*** ../vim-7.4.101/src/version.c	2013-11-21 17:12:55.000000000 +0100
Karsten Hopp cc5be8
--- src/version.c	2013-11-21 17:38:21.000000000 +0100
Karsten Hopp cc5be8
***************
Karsten Hopp cc5be8
*** 740,741 ****
Karsten Hopp cc5be8
--- 740,743 ----
Karsten Hopp cc5be8
  {   /* Add new patch number below this line */
Karsten Hopp cc5be8
+ /**/
Karsten Hopp cc5be8
+     102,
Karsten Hopp cc5be8
  /**/
Karsten Hopp cc5be8
Karsten Hopp cc5be8
-- 
Karsten Hopp cc5be8
Engineers will go without food and hygiene for days to solve a problem.
Karsten Hopp cc5be8
(Other times just because they forgot.)
Karsten Hopp cc5be8
				(Scott Adams - The Dilbert principle)
Karsten Hopp cc5be8
Karsten Hopp cc5be8
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp cc5be8
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp cc5be8
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp cc5be8
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///