mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0398: illegal memory access with "t"
Problem: Illegal memory access with "t". Solution: Use strncmp() instead of memcmp(). (Dominique Pelle, closes #1528)
This commit is contained in:
@@ -1693,12 +1693,9 @@ searchc(cmdarg_T *cap, int t_cmd)
|
||||
if (p[col] == c && stop)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (memcmp(p + col, lastc_bytes, lastc_bytelen) == 0
|
||||
else if (STRNCMP(p + col, lastc_bytes, lastc_bytelen) == 0
|
||||
&& stop)
|
||||
break;
|
||||
}
|
||||
stop = TRUE;
|
||||
}
|
||||
}
|
||||
|
@@ -294,3 +294,10 @@ func Test_searchpair()
|
||||
q!
|
||||
endfunc
|
||||
|
||||
func Test_searchc()
|
||||
" These commands used to cause memory overflow in searchc().
|
||||
new
|
||||
norm ixx
|
||||
exe "norm 0t\u93cf"
|
||||
bw!
|
||||
endfunc
|
||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
398,
|
||||
/**/
|
||||
397,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user