summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-12 23:03:19 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-12 23:03:19 +0200
commita890f5e34887bff7616bdb4b9ee0bf98c8d2a8f0 (patch)
tree6dd19ec64d2d9516eb07c09478294ca1a6eba649
parentc95a302a4c42ec8230473cd4a5e0064d0a143aa8 (diff)
downloadvim-git-a890f5e34887bff7616bdb4b9ee0bf98c8d2a8f0.tar.gz
patch 7.4.1926v7.4.1926
Problem: Possible crash with many history items. Solution: Avoid the index going past the last item.
-rw-r--r--src/ex_getln.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index fd47ef3df..2f5793a65 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -6448,7 +6448,7 @@ merge_history(int type)
else
clear_hist_entry(&new_hist[i]);
}
- hisidx[type] = len - 1;
+ hisidx[type] = (i < len ? i : len) - 1;
/* Free what is not kept. */
for (i = 0; i < viminfo_hisidx[type]; i++)
diff --git a/src/version.c b/src/version.c
index 9c821d492..4f5b5a390 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1926,
+/**/
1925,
/**/
1924,