forked from aniani/vim
patch 7.4.1939
Problem: Memory access error when reading viminfo. (Dominique Pelle) Solution: Correct index in jumplist when at the end.
This commit is contained in:
@@ -1525,6 +1525,9 @@ handle_viminfo_mark(garray_T *values, int force)
|
||||
if (idx < 0 && curwin->w_jumplistlen < JUMPLISTSIZE)
|
||||
/* insert as the oldest entry */
|
||||
idx = 0;
|
||||
else if (idx == 0 && curwin->w_jumplistlen == JUMPLISTSIZE)
|
||||
/* no space to insert as the oldest entry */
|
||||
idx = -1;
|
||||
}
|
||||
else if (curwin->w_jumplistlen < JUMPLISTSIZE)
|
||||
/* insert as oldest entry */
|
||||
@@ -1537,6 +1540,7 @@ handle_viminfo_mark(garray_T *values, int force)
|
||||
if (curwin->w_jumplistlen == JUMPLISTSIZE)
|
||||
{
|
||||
/* Drop the oldest entry. */
|
||||
--idx;
|
||||
vim_free(curwin->w_jumplist[0].fname);
|
||||
for (i = 0; i < idx; ++i)
|
||||
curwin->w_jumplist[i] = curwin->w_jumplist[i + 1];
|
||||
|
Reference in New Issue
Block a user