3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.102
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.102
3ef2ca
Problem:    Crash when interrupting "z=".
3ef2ca
Solution:   Add safety check for word length. (Christian Brabandt, Dominique
3ef2ca
	    Pelle)
3ef2ca
Files:	    src/spell.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.101/src/spell.c	2013-11-14 03:54:02.000000000 +0100
3ef2ca
--- src/spell.c	2013-11-21 17:37:04.000000000 +0100
3ef2ca
***************
3ef2ca
*** 13398,13406 ****
3ef2ca
  
3ef2ca
  	/* Lookup the word "orgnr" one of the two tries. */
3ef2ca
  	n = 0;
3ef2ca
- 	wlen = 0;
3ef2ca
  	wordcount = 0;
3ef2ca
! 	for (;;)
3ef2ca
  	{
3ef2ca
  	    i = 1;
3ef2ca
  	    if (wordcount == orgnr && byts[n + 1] == NUL)
3ef2ca
--- 13398,13405 ----
3ef2ca
  
3ef2ca
  	/* Lookup the word "orgnr" one of the two tries. */
3ef2ca
  	n = 0;
3ef2ca
  	wordcount = 0;
3ef2ca
! 	for (wlen = 0; wlen < MAXWLEN - 3; ++wlen)
3ef2ca
  	{
3ef2ca
  	    i = 1;
3ef2ca
  	    if (wordcount == orgnr && byts[n + 1] == NUL)
3ef2ca
***************
3ef2ca
*** 13414,13419 ****
3ef2ca
--- 13413,13419 ----
3ef2ca
  		if (i > byts[n])	/* safety check */
3ef2ca
  		{
3ef2ca
  		    STRCPY(theword + wlen, "BAD");
3ef2ca
+ 		    wlen += 3;
3ef2ca
  		    goto badword;
3ef2ca
  		}
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 13426,13432 ****
3ef2ca
  		wordcount += wc;
3ef2ca
  	    }
3ef2ca
  
3ef2ca
! 	    theword[wlen++] = byts[n + i];
3ef2ca
  	    n = idxs[n + i];
3ef2ca
  	}
3ef2ca
  badword:
3ef2ca
--- 13426,13432 ----
3ef2ca
  		wordcount += wc;
3ef2ca
  	    }
3ef2ca
  
3ef2ca
! 	    theword[wlen] = byts[n + i];
3ef2ca
  	    n = idxs[n + i];
3ef2ca
  	}
3ef2ca
  badword:
3ef2ca
*** ../vim-7.4.101/src/version.c	2013-11-21 17:12:55.000000000 +0100
3ef2ca
--- src/version.c	2013-11-21 17:38:21.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     102,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
Engineers will go without food and hygiene for days to solve a problem.
3ef2ca
(Other times just because they forgot.)
3ef2ca
				(Scott Adams - The Dilbert principle)
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    ///