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
@@ -2958,8 +2958,7 @@ | ||
2958 | 2958 | cmod->cmod_save_ei = NULL; |
2959 | 2959 | } |
2960 | 2960 | |
2961 | - if (cmod->cmod_filter_regmatch.regprog != NULL) | |
2962 | - vim_regfree(cmod->cmod_filter_regmatch.regprog); | |
2961 | + vim_regfree(cmod->cmod_filter_regmatch.regprog); | |
2963 | 2962 | |
2964 | 2963 | if (cmod->cmod_save_msg_silent > 0) |
2965 | 2964 | { |
@@ -4696,6 +4695,8 @@ | ||
4696 | 4695 | { |
4697 | 4696 | p += 2; |
4698 | 4697 | (void)skip_expr(&p, NULL); |
4698 | + if (*p == NUL) // stop at NUL after CTRL-V | |
4699 | + break; | |
4699 | 4700 | } |
4700 | 4701 | #endif |
4701 | 4702 |
@@ -1832,4 +1832,11 @@ | ||
1832 | 1832 | bwipe! |
1833 | 1833 | endfunc |
1834 | 1834 | |
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 | + | |
1835 | 1842 | " vim: shiftwidth=2 sts=2 expandtab |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 1910, | |
755 | +/**/ | |
754 | 756 | 1909, |
755 | 757 | /**/ |
756 | 758 | 1908, |