• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン51bc501a13caf39b4e5704fa53b5986a1d9b444b (tree)
日時2020-10-27 05:45:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.1910: reading past the end of the command line

Commit: https://github.com/vim/vim/commit/caf73dcfade0a435ea3f989285b43f07c40c9948
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 26 21:39:13 2020 +0100

patch 8.2.1910: reading past the end of the command line
Problem: Reading past the end of the command line.
Solution: Check for NUL. (closes https://github.com/vim/vim/issues/7204)

変更サマリ

差分

diff -r 5b7ea82bc18f -r 51bc501a13ca src/ex_docmd.c
--- a/src/ex_docmd.c Mon Oct 26 21:15:07 2020 +0100
+++ b/src/ex_docmd.c Mon Oct 26 21:45:04 2020 +0100
@@ -2958,8 +2958,7 @@
29582958 cmod->cmod_save_ei = NULL;
29592959 }
29602960
2961- if (cmod->cmod_filter_regmatch.regprog != NULL)
2962- vim_regfree(cmod->cmod_filter_regmatch.regprog);
2961+ vim_regfree(cmod->cmod_filter_regmatch.regprog);
29632962
29642963 if (cmod->cmod_save_msg_silent > 0)
29652964 {
@@ -4696,6 +4695,8 @@
46964695 {
46974696 p += 2;
46984697 (void)skip_expr(&p, NULL);
4698+ if (*p == NUL) // stop at NUL after CTRL-V
4699+ break;
46994700 }
47004701 #endif
47014702
diff -r 5b7ea82bc18f -r 51bc501a13ca src/testdir/test_edit.vim
--- a/src/testdir/test_edit.vim Mon Oct 26 21:15:07 2020 +0100
+++ b/src/testdir/test_edit.vim Mon Oct 26 21:45:04 2020 +0100
@@ -1832,4 +1832,11 @@
18321832 bwipe!
18331833 endfunc
18341834
1835+func Test_read_invalid()
1836+ set encoding=latin1
1837+ " This was not properly checking for going past the end.
1838+ call assert_fails('r`=', 'E484')
1839+ set encoding=utf-8
1840+endfunc
1841+
18351842 " vim: shiftwidth=2 sts=2 expandtab
diff -r 5b7ea82bc18f -r 51bc501a13ca src/version.c
--- a/src/version.c Mon Oct 26 21:15:07 2020 +0100
+++ b/src/version.c Mon Oct 26 21:45:04 2020 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 1910,
755+/**/
754756 1909,
755757 /**/
756758 1908,
旧リポジトリブラウザで表示