mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
vim-patch:7.4.714
Problem: Illegal memory access when there are illegal bytes.
Solution: Check the byte length of the character. (Dominique Pelle)
069dd08d8d
This commit is contained in:
@@ -5333,10 +5333,12 @@ do_class:
|
||||
if ((len = (*mb_ptr2len)(opnd)) > 1) {
|
||||
if (ireg_ic && enc_utf8)
|
||||
cf = utf_fold(utf_ptr2char(opnd));
|
||||
while (count < maxcount) {
|
||||
for (i = 0; i < len; ++i)
|
||||
if (opnd[i] != scan[i])
|
||||
while (count < maxcount && (*mb_ptr2len)(scan) >= len) {
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (opnd[i] != scan[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < len && (!ireg_ic || !enc_utf8
|
||||
|| utf_fold(utf_ptr2char(scan)) != cf))
|
||||
break;
|
||||
|
@@ -410,7 +410,7 @@ static int included_patches[] = {
|
||||
// 717,
|
||||
// 716,
|
||||
// 715,
|
||||
// 714,
|
||||
714,
|
||||
713,
|
||||
712,
|
||||
711,
|
||||
|
Reference in New Issue
Block a user