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