42380ab
To: vim-dev@vim.org
42380ab
Subject: patch 7.1.076
42380ab
Fcc: outbox
42380ab
From: Bram Moolenaar <Bram@moolenaar.net>
42380ab
Mime-Version: 1.0
42380ab
Content-Type: text/plain; charset=ISO-8859-1
42380ab
Content-Transfer-Encoding: 8bit
42380ab
------------
42380ab
42380ab
Patch 7.1.076
42380ab
Problem:    Another strcpy() with overlapping arguments.
42380ab
Solution:   Use mch_memmove(). (Dominique Pelle)  And another one.
42380ab
Files:	    src/ex_docmd.c, src/normal.c
42380ab
42380ab
42380ab
*** ../vim-7.1.075/src/ex_docmd.c	Sat Aug 11 15:59:44 2007
42380ab
--- src/ex_docmd.c	Wed Aug  8 22:28:33 2007
42380ab
***************
42380ab
*** 4493,4499 ****
42380ab
  	    if (eap->argt & (USECTRLV | XFILE))
42380ab
  		++p;		/* skip CTRL-V and next char */
42380ab
  	    else
42380ab
! 		STRCPY(p, p + 1);	/* remove CTRL-V and skip next char */
42380ab
  	    if (*p == NUL)		/* stop at NUL after CTRL-V */
42380ab
  		break;
42380ab
  	}
42380ab
--- 4493,4500 ----
42380ab
  	    if (eap->argt & (USECTRLV | XFILE))
42380ab
  		++p;		/* skip CTRL-V and next char */
42380ab
  	    else
42380ab
! 				/* remove CTRL-V and skip next char */
42380ab
! 		mch_memmove(p, p + 1, STRLEN(p));
42380ab
  	    if (*p == NUL)		/* stop at NUL after CTRL-V */
42380ab
  		break;
42380ab
  	}
42380ab
*** ../vim-7.1.075/src/normal.c	Wed Aug  8 21:41:19 2007
42380ab
--- src/normal.c	Sun Aug 12 17:35:20 2007
42380ab
***************
42380ab
*** 3760,3766 ****
42380ab
      extra_len = (int)STRLEN(p);
42380ab
      overflow = old_len + extra_len - SHOWCMD_COLS;
42380ab
      if (overflow > 0)
42380ab
! 	STRCPY(showcmd_buf, showcmd_buf + overflow);
42380ab
      STRCAT(showcmd_buf, p);
42380ab
  
42380ab
      if (char_avail())
42380ab
--- 3760,3767 ----
42380ab
      extra_len = (int)STRLEN(p);
42380ab
      overflow = old_len + extra_len - SHOWCMD_COLS;
42380ab
      if (overflow > 0)
42380ab
! 	mch_memmove(showcmd_buf, showcmd_buf + overflow,
42380ab
! 						      old_len - overflow + 1);
42380ab
      STRCAT(showcmd_buf, p);
42380ab
  
42380ab
      if (char_avail())
42380ab
*** ../vim-7.1.075/src/version.c	Tue Aug 14 22:40:13 2007
42380ab
--- src/version.c	Tue Aug 14 22:53:13 2007
42380ab
***************
42380ab
*** 668,669 ****
42380ab
--- 668,671 ----
42380ab
  {   /* Add new patch number below this line */
42380ab
+ /**/
42380ab
+     76,
42380ab
  /**/
42380ab
42380ab
-- 
42380ab
hundred-and-one symptoms of being an internet addict:
42380ab
161. You get up before the sun rises to check your e-mail, and you
42380ab
     find yourself in the very same chair long after the sun has set.
42380ab
42380ab
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
42380ab
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
42380ab
\\\        download, build and distribute -- http://www.A-A-P.org        ///
42380ab
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///