Karsten Hopp f6d99c
To: vim-dev@vim.org
Karsten Hopp f6d99c
Subject: Patch 7.1.171
Karsten Hopp f6d99c
Fcc: outbox
Karsten Hopp f6d99c
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f6d99c
Mime-Version: 1.0
Karsten Hopp f6d99c
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp f6d99c
Content-Transfer-Encoding: 8bit
Karsten Hopp f6d99c
------------
Karsten Hopp f6d99c
Karsten Hopp f6d99c
Patch 7.1.171
Karsten Hopp f6d99c
Problem:    Reading one byte before allocated memory.
Karsten Hopp f6d99c
Solution:   Check index not to become negative. (Dominique Pelle)
Karsten Hopp f6d99c
Files:	    src/ex_getln.c
Karsten Hopp f6d99c
Karsten Hopp f6d99c
Karsten Hopp f6d99c
*** ../vim-7.1.170/src/ex_getln.c	Tue Oct 30 17:36:31 2007
Karsten Hopp f6d99c
--- src/ex_getln.c	Tue Dec  4 21:49:24 2007
Karsten Hopp f6d99c
***************
Karsten Hopp f6d99c
*** 1186,1195 ****
Karsten Hopp f6d99c
  	case K_LEFT:
Karsten Hopp f6d99c
  	case K_S_LEFT:
Karsten Hopp f6d99c
  	case K_C_LEFT:
Karsten Hopp f6d99c
  		do
Karsten Hopp f6d99c
  		{
Karsten Hopp f6d99c
- 		    if (ccline.cmdpos == 0)
Karsten Hopp f6d99c
- 			break;
Karsten Hopp f6d99c
  		    --ccline.cmdpos;
Karsten Hopp f6d99c
  #ifdef FEAT_MBYTE
Karsten Hopp f6d99c
  		    if (has_mbyte)	/* move to first byte of char */
Karsten Hopp f6d99c
--- 1186,1195 ----
Karsten Hopp f6d99c
  	case K_LEFT:
Karsten Hopp f6d99c
  	case K_S_LEFT:
Karsten Hopp f6d99c
  	case K_C_LEFT:
Karsten Hopp f6d99c
+ 		if (ccline.cmdpos == 0)
Karsten Hopp f6d99c
+ 		    goto cmdline_not_changed;
Karsten Hopp f6d99c
  		do
Karsten Hopp f6d99c
  		{
Karsten Hopp f6d99c
  		    --ccline.cmdpos;
Karsten Hopp f6d99c
  #ifdef FEAT_MBYTE
Karsten Hopp f6d99c
  		    if (has_mbyte)	/* move to first byte of char */
Karsten Hopp f6d99c
***************
Karsten Hopp f6d99c
*** 1198,1204 ****
Karsten Hopp f6d99c
  #endif
Karsten Hopp f6d99c
  		    ccline.cmdspos -= cmdline_charsize(ccline.cmdpos);
Karsten Hopp f6d99c
  		}
Karsten Hopp f6d99c
! 		while ((c == K_S_LEFT || c == K_C_LEFT
Karsten Hopp f6d99c
  			       || (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)))
Karsten Hopp f6d99c
  			&& ccline.cmdbuff[ccline.cmdpos - 1] != ' ');
Karsten Hopp f6d99c
  #ifdef FEAT_MBYTE
Karsten Hopp f6d99c
--- 1198,1205 ----
Karsten Hopp f6d99c
  #endif
Karsten Hopp f6d99c
  		    ccline.cmdspos -= cmdline_charsize(ccline.cmdpos);
Karsten Hopp f6d99c
  		}
Karsten Hopp f6d99c
! 		while (ccline.cmdpos > 0
Karsten Hopp f6d99c
! 			&& (c == K_S_LEFT || c == K_C_LEFT
Karsten Hopp f6d99c
  			       || (mod_mask & (MOD_MASK_SHIFT|MOD_MASK_CTRL)))
Karsten Hopp f6d99c
  			&& ccline.cmdbuff[ccline.cmdpos - 1] != ' ');
Karsten Hopp f6d99c
  #ifdef FEAT_MBYTE
Karsten Hopp f6d99c
*** ../vim-7.1.170/src/version.c	Fri Dec  7 17:30:04 2007
Karsten Hopp f6d99c
--- src/version.c	Fri Dec  7 20:00:06 2007
Karsten Hopp f6d99c
***************
Karsten Hopp f6d99c
*** 668,669 ****
Karsten Hopp f6d99c
--- 668,671 ----
Karsten Hopp f6d99c
  {   /* Add new patch number below this line */
Karsten Hopp f6d99c
+ /**/
Karsten Hopp f6d99c
+     171,
Karsten Hopp f6d99c
  /**/
Karsten Hopp f6d99c
Karsten Hopp f6d99c
-- 
Karsten Hopp f6d99c
Some of the well know MS-Windows errors:
Karsten Hopp f6d99c
	EMULTI		Multitasking attempted, system confused
Karsten Hopp f6d99c
	EKEYBOARD	Keyboard locked, try getting out of this one!
Karsten Hopp f6d99c
	EXPLAIN		Unexplained error, please tell us what happened
Karsten Hopp f6d99c
	EFUTURE		Reserved for our future mistakes
Karsten Hopp f6d99c
Karsten Hopp f6d99c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f6d99c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f6d99c
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp f6d99c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///