jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.102

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