mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00
vim-patch:9.0.1477: crash when recovering from corrupted swap file
Problem: Crash when recovering from corrupted swap file. Solution: Check for a valid page count. (closes vim/vim#12275)b67ba03d3e
Co-authored-by: Bram Moolenaar <Bram@vim.org> (cherry picked from commitdcb6b5c62d
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
c52085997b
commit
e937b9a9c7
@@ -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
|
||||
|
Reference in New Issue
Block a user