mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2779: memory access error in remove() for blob
Problem: Memory access error in remove() for blob. Solution: Adjust length for memmove().
This commit is contained in:
@@ -444,7 +444,7 @@ blob_remove(typval_T *argvars, typval_T *rettv)
|
|||||||
{
|
{
|
||||||
blob_T *blob;
|
blob_T *blob;
|
||||||
|
|
||||||
// Remove range of items, return list with values.
|
// Remove range of items, return blob with values.
|
||||||
end = (long)tv_get_number_chk(&argvars[2], &error);
|
end = (long)tv_get_number_chk(&argvars[2], &error);
|
||||||
if (error)
|
if (error)
|
||||||
return;
|
return;
|
||||||
@@ -472,7 +472,8 @@ blob_remove(typval_T *argvars, typval_T *rettv)
|
|||||||
rettv->v_type = VAR_BLOB;
|
rettv->v_type = VAR_BLOB;
|
||||||
rettv->vval.v_blob = blob;
|
rettv->vval.v_blob = blob;
|
||||||
|
|
||||||
mch_memmove(p + idx, p + end + 1, (size_t)(len - end));
|
if (len - end - 1 > 0)
|
||||||
|
mch_memmove(p + idx, p + end + 1, (size_t)(len - end - 1));
|
||||||
b->bv_ga.ga_len -= end - idx + 1;
|
b->bv_ga.ga_len -= end - idx + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -750,6 +750,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 */
|
||||||
|
/**/
|
||||||
|
2779,
|
||||||
/**/
|
/**/
|
||||||
2778,
|
2778,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user