To: vim_dev@googlegroups.com Subject: Patch 7.4.1926 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1926 Problem: Possible crash with many history items. Solution: Avoid the index going past the last item. Files: src/ex_getln.c *** ../vim-7.4.1925/src/ex_getln.c 2016-06-11 21:04:34.923761324 +0200 --- src/ex_getln.c 2016-06-12 20:25:25.809844827 +0200 *************** *** 6448,6454 **** else clear_hist_entry(&new_hist[i]); } ! hisidx[type] = len - 1; /* Free what is not kept. */ for (i = 0; i < viminfo_hisidx[type]; i++) --- 6448,6454 ---- else clear_hist_entry(&new_hist[i]); } ! hisidx[type] = (i < len ? i : len) - 1; /* Free what is not kept. */ for (i = 0; i < viminfo_hisidx[type]; i++) *** ../vim-7.4.1925/src/version.c 2016-06-12 21:20:50.945837385 +0200 --- src/version.c 2016-06-12 23:02:44.979891820 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1926, /**/ -- You can't have everything. Where would you put it? -- Steven Wright /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///