mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0937: invalid memory access in search pattern
Problem: Invalid memory access in search pattern. (Kuang-che Wu)
Solution: Check for incomplete collation element. (Dominique Pelle,
closes vim/vim#3985)
f1b57ab2ab
This commit is contained in:
parent
279ecaff00
commit
486234ab3d
@ -1103,7 +1103,7 @@ static int get_coll_element(char_u **pp)
|
||||
int l = 1;
|
||||
char_u *p = *pp;
|
||||
|
||||
if (p[0] != NUL && p[1] == '.') {
|
||||
if (p[0] != NUL && p[1] == '.' && p[2] != NUL) {
|
||||
l = utfc_ptr2len(p + 2);
|
||||
if (p[l + 2] == '.' && p[l + 3] == ']') {
|
||||
c = utf_ptr2char(p + 2);
|
||||
|
@ -44,4 +44,6 @@ func Test_get_equi_class()
|
||||
" Incomplete equivalence class caused invalid memory access
|
||||
s/^/[[=
|
||||
call assert_equal(1, search(getline(1)))
|
||||
s/.*/[[.
|
||||
call assert_equal(1, search(getline(1)))
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user