forked from aniani/vim
patch 9.0.1145: invalid memory access with recursive substitute expression
Problem: Invalid memory access with recursive substitute expression. Solution: Check the return value of vim_regsub().
This commit is contained in:
@@ -7312,6 +7312,11 @@ do_string_sub(
|
||||
* - The text after the match.
|
||||
*/
|
||||
sublen = vim_regsub(®match, sub, expr, tail, 0, REGSUB_MAGIC);
|
||||
if (sublen <= 0)
|
||||
{
|
||||
ga_clear(&ga);
|
||||
break;
|
||||
}
|
||||
if (ga_grow(&ga, (int)((end - tail) + sublen -
|
||||
(regmatch.endp[0] - regmatch.startp[0]))) == FAIL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user