mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.0934: invalid memory access in search pattern
Problem: Invalid memory access in search pattern. (Kuang-che Wu) Solution: Check for incomplete equivalence class. (closes #3970)
This commit is contained in:
parent
6982f42f33
commit
985079c514
@ -730,7 +730,7 @@ get_equi_class(char_u **pp)
|
|||||||
int l = 1;
|
int l = 1;
|
||||||
char_u *p = *pp;
|
char_u *p = *pp;
|
||||||
|
|
||||||
if (p[1] == '=')
|
if (p[1] == '=' && p[2] != NUL)
|
||||||
{
|
{
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
l = (*mb_ptr2len)(p + 2);
|
l = (*mb_ptr2len)(p + 2);
|
||||||
|
@ -97,3 +97,10 @@ func Test_out_of_memory()
|
|||||||
" This will be slow...
|
" This will be slow...
|
||||||
call assert_fails('call search("\\v((n||<)+);")', 'E363:')
|
call assert_fails('call search("\\v((n||<)+);")', 'E363:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_get_equi_class()
|
||||||
|
new
|
||||||
|
" Incomplete equivalence class caused invalid memory access
|
||||||
|
s/^/[[=
|
||||||
|
call assert_equal(1, search(getline(1)))
|
||||||
|
endfunc
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
934,
|
||||||
/**/
|
/**/
|
||||||
933,
|
933,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user