mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
vim-patch:8.1.1812: reading a truncted undo file hangs Vim
Problem: Reading a truncted undo file hangs Vim.
Solution: Check for reading EOF. (closes vim/vim#4769)
fb06d767a8
This commit is contained in:
@@ -878,7 +878,12 @@ static u_header_T *unserialize_uhp(bufinfo_T *bi,
|
||||
for (;; ) {
|
||||
int len = undo_read_byte(bi);
|
||||
|
||||
if (len == 0 || len == EOF) {
|
||||
if (len == EOF) {
|
||||
corruption_error("truncated", file_name);
|
||||
u_free_uhp(uhp);
|
||||
return NULL;
|
||||
}
|
||||
if (len == 0) {
|
||||
break;
|
||||
}
|
||||
int what = undo_read_byte(bi);
|
||||
|
Reference in New Issue
Block a user