81f527a
To: vim_dev@googlegroups.com
81f527a
Subject: Patch 7.3.040
81f527a
Fcc: outbox
81f527a
From: Bram Moolenaar <Bram@moolenaar.net>
81f527a
Mime-Version: 1.0
81f527a
Content-Type: text/plain; charset=UTF-8
81f527a
Content-Transfer-Encoding: 8bit
81f527a
------------
81f527a
81f527a
Patch 7.3.040
81f527a
Problem:    Comparing strings while ignoring case goes beyond end of the
81f527a
	    string when there are illegal bytes. (Dominique Pelle)
81f527a
Solution:   Explicitly check for illegal bytes.
81f527a
Files:	    src/mbyte.c
81f527a
81f527a
81f527a
*** ../vim-7.3.039/src/mbyte.c	2010-10-23 14:02:48.000000000 +0200
81f527a
--- src/mbyte.c	2010-10-27 13:34:16.000000000 +0200
81f527a
***************
81f527a
*** 3124,3129 ****
81f527a
--- 3124,3132 ----
81f527a
  		/* If one of the two characters is incomplete return -1. */
81f527a
  		if (incomplete || i + utf_byte2len(s2[i]) > n)
81f527a
  		    return -1;
81f527a
+ 		/* Don't case-fold illegal bytes or truncated characters. */
81f527a
+ 		if (utf_ptr2len(s1 + i) < l || utf_ptr2len(s2 + i) < l)
81f527a
+ 		    return -1;
81f527a
  		cdiff = utf_fold(utf_ptr2char(s1 + i))
81f527a
  					     - utf_fold(utf_ptr2char(s2 + i));
81f527a
  		if (cdiff != 0)
81f527a
*** ../vim-7.3.039/src/version.c	2010-10-27 12:58:19.000000000 +0200
81f527a
--- src/version.c	2010-10-27 13:25:16.000000000 +0200
81f527a
***************
81f527a
*** 716,717 ****
81f527a
--- 716,719 ----
81f527a
  {   /* Add new patch number below this line */
81f527a
+ /**/
81f527a
+     40,
81f527a
  /**/
81f527a
81f527a
-- 
81f527a
    With sufficient thrust, pigs fly just fine.
81f527a
                   -- RFC 1925
81f527a
81f527a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
81f527a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
81f527a
\\\        download, build and distribute -- http://www.A-A-P.org        ///
81f527a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///