0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.3.040

Problem:    Comparing strings while ignoring case goes beyond end of the
            string when there are illegal bytes. (Dominique Pelle)
Solution:   Explicitly check for illegal bytes.
This commit is contained in:
Bram Moolenaar
2010-10-27 13:37:44 +02:00
parent fc3c83e47e
commit c395a3aac2
2 changed files with 5 additions and 0 deletions

View File

@@ -3124,6 +3124,9 @@ mb_strnicmp(s1, s2, nn)
/* If one of the two characters is incomplete return -1. */
if (incomplete || i + utf_byte2len(s2[i]) > n)
return -1;
/* Don't case-fold illegal bytes or truncated characters. */
if (utf_ptr2len(s1 + i) < l || utf_ptr2len(s2 + i) < l)
return -1;
cdiff = utf_fold(utf_ptr2char(s1 + i))
- utf_fold(utf_ptr2char(s2 + i));
if (cdiff != 0)

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
40,
/**/
39,
/**/