comparison src/undo.c @ 17630:380adf86bf66 v8.1.1812

patch 8.1.1812: reading a truncted undo file hangs Vim commit https://github.com/vim/vim/commit/fb06d767a8d76eead5391302fc88115d6e3879d8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 4 18:55:35 2019 +0200 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 https://github.com/vim/vim/issues/4769)
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Aug 2019 19:00:04 +0200
parents d03a52e02f1a
children 0f7ae8010787
comparison
equal deleted inserted replaced
17629:a85a222d1a34 17630:380adf86bf66
1315 for (;;) 1315 for (;;)
1316 { 1316 {
1317 int len = undo_read_byte(bi); 1317 int len = undo_read_byte(bi);
1318 int what; 1318 int what;
1319 1319
1320 if (len == EOF)
1321 {
1322 corruption_error("truncated", file_name);
1323 u_free_uhp(uhp);
1324 return NULL;
1325 }
1320 if (len == 0) 1326 if (len == 0)
1321 break; 1327 break;
1322 what = undo_read_byte(bi); 1328 what = undo_read_byte(bi);
1323 switch (what) 1329 switch (what)
1324 { 1330 {