aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-05 20:31:19 -0400
committerGitHub <noreply@github.com>2020-10-05 20:31:19 -0400
commitf8a5b4bdce489f4df7df15d0b363b608853b92d6 (patch)
treef376500b5b2225d0d98871d3ab981a0e590ae31b /src/nvim/undo.c
parentc76fc7942b3a88b90c6f0bc7fafabe1f55c7814e (diff)
parent674844086b0bc76a8878c6365323afbdb08580d4 (diff)
downloadrneovim-f8a5b4bdce489f4df7df15d0b363b608853b92d6.tar.gz
rneovim-f8a5b4bdce489f4df7df15d0b363b608853b92d6.tar.bz2
rneovim-f8a5b4bdce489f4df7df15d0b363b608853b92d6.zip
Merge pull request #13039 from janlazo/vim-8.2.1790
vim-patch:8.1.{1812,2024,2239,2242,2247,2249,2253},8.2.{354,603,609,665,1570,1790,1792,1801}
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r--src/nvim/undo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 903e57732f..6c5a6cdb46 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -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);