0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -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);

View File

@ -103,6 +103,8 @@ 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
func Test_rex_init()

View File

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