mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
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 #4769)
This commit is contained in:
@@ -1317,6 +1317,12 @@ unserialize_uhp(bufinfo_T *bi, char_u *file_name)
|
||||
int len = undo_read_byte(bi);
|
||||
int what;
|
||||
|
||||
if (len == EOF)
|
||||
{
|
||||
corruption_error("truncated", file_name);
|
||||
u_free_uhp(uhp);
|
||||
return NULL;
|
||||
}
|
||||
if (len == 0)
|
||||
break;
|
||||
what = undo_read_byte(bi);
|
||||
|
Reference in New Issue
Block a user