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

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 #3985)
This commit is contained in:
Bram Moolenaar
2019-02-17 13:53:34 +01:00
parent 55c77cf2ea
commit f1b57ab2ab
3 changed files with 5 additions and 1 deletions

View File

@@ -1111,7 +1111,7 @@ 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)
{
if (has_mbyte)
l = (*mb_ptr2len)(p + 2);