diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-23 08:24:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 08:24:10 +0800 |
commit | 77ff25b1d9ab5869d852779cae8fc6a1245f3ea7 (patch) | |
tree | 0eaf8af285049ca4972d127724bb26a465876c61 /test | |
parent | 431b152726013ec6a5cece0285e7c103673bc511 (diff) | |
download | rneovim-77ff25b1d9ab5869d852779cae8fc6a1245f3ea7.tar.gz rneovim-77ff25b1d9ab5869d852779cae8fc6a1245f3ea7.tar.bz2 rneovim-77ff25b1d9ab5869d852779cae8fc6a1245f3ea7.zip |
vim-patch:9.0.1477: crash when recovering from corrupted swap file (#23273)
Problem: Crash when recovering from corrupted swap file.
Solution: Check for a valid page count. (closes vim/vim#12275)
https://github.com/vim/vim/commit/b67ba03d3ef2e6c5f207d508e85fc6906f938028
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_recover.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/old/testdir/test_recover.vim b/test/old/testdir/test_recover.vim index 92e22687af..81e2dde1e2 100644 --- a/test/old/testdir/test_recover.vim +++ b/test/old/testdir/test_recover.vim @@ -259,6 +259,14 @@ func Test_recover_corrupted_swap_file() call assert_equal(['???EMPTY BLOCK'], getline(1, '$')) bw! + " set the number of pointers in a pointer block to a large value + let b = copy(save_b) + let b[4098:4099] = 0zFFFF + call writefile(b, sn) + call assert_fails('recover Xfile1', 'E1364:') + call assert_equal('Xfile1', @%) + bw! + " set the block number in a pointer entry to a negative number let b = copy(save_b) if system_64bit |