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:
parent
55c77cf2ea
commit
f1b57ab2ab
@ -1111,7 +1111,7 @@ get_coll_element(char_u **pp)
|
|||||||
int l = 1;
|
int l = 1;
|
||||||
char_u *p = *pp;
|
char_u *p = *pp;
|
||||||
|
|
||||||
if (p[0] != NUL && p[1] == '.')
|
if (p[0] != NUL && p[1] == '.' && p[2] != NUL)
|
||||||
{
|
{
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
l = (*mb_ptr2len)(p + 2);
|
l = (*mb_ptr2len)(p + 2);
|
||||||
|
@ -103,6 +103,8 @@ func Test_get_equi_class()
|
|||||||
" Incomplete equivalence class caused invalid memory access
|
" Incomplete equivalence class caused invalid memory access
|
||||||
s/^/[[=
|
s/^/[[=
|
||||||
call assert_equal(1, search(getline(1)))
|
call assert_equal(1, search(getline(1)))
|
||||||
|
s/.*/[[.
|
||||||
|
call assert_equal(1, search(getline(1)))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_rex_init()
|
func Test_rex_init()
|
||||||
|
@ -779,6 +779,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
937,
|
||||||
/**/
|
/**/
|
||||||
936,
|
936,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user