mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.3402: invalid memory access when using :retab with large value
Problem: Invalid memory access when using :retab with large value. Solution: Check the number is positive.
This commit is contained in:
@@ -2240,7 +2240,7 @@ ambw_end:
|
||||
if (errmsg == NULL)
|
||||
{
|
||||
int *oldarray = curbuf->b_p_vsts_array;
|
||||
if (tabstop_set(*varp, &(curbuf->b_p_vsts_array)))
|
||||
if (tabstop_set(*varp, &(curbuf->b_p_vsts_array)) == OK)
|
||||
{
|
||||
if (oldarray)
|
||||
vim_free(oldarray);
|
||||
@@ -2279,7 +2279,7 @@ ambw_end:
|
||||
{
|
||||
int *oldarray = curbuf->b_p_vts_array;
|
||||
|
||||
if (tabstop_set(*varp, &(curbuf->b_p_vts_array)))
|
||||
if (tabstop_set(*varp, &(curbuf->b_p_vts_array)) == OK)
|
||||
{
|
||||
vim_free(oldarray);
|
||||
#ifdef FEAT_FOLDING
|
||||
|
Reference in New Issue
Block a user