]> granicus.if.org Git - vim/commitdiff
patch 7.4.1926 v7.4.1926
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Jun 2016 21:03:19 +0000 (23:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Jun 2016 21:03:19 +0000 (23:03 +0200)
Problem:    Possible crash with many history items.
Solution:   Avoid the index going past the last item.

src/ex_getln.c
src/version.c

index fd47ef3df0151c260a6cab52cb01eceb6df1e0e8..2f5793a65fe2d20249dc6844190e3f5599b07397 100644 (file)
@@ -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++)
index 9c821d492b1edaab7c85a51c2806d17ce54b6dc4..4f5b5a390f57e1a6cbb136ddaa3f08b9a18d73cb 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1926,
 /**/
     1925,
 /**/