astepano / rpms / vim

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