0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.1972: crash when recreating nested fold

Problem:    Crash when recreating nested fold.
Solution:   Check for empty growarray. (closes #7278)
This commit is contained in:
Bram Moolenaar
2020-11-10 18:23:52 +01:00
parent c56936e2ba
commit 5e1f22ff61
3 changed files with 16 additions and 1 deletions

View File

@@ -640,7 +640,10 @@ foldCreate(linenr_T start, linenr_T end)
break;
}
}
i = (int)(fp - (fold_T *)gap->ga_data);
if (gap->ga_len == 0)
i = 0;
else
i = (int)(fp - (fold_T *)gap->ga_data);
}
if (ga_grow(gap, 1) == OK)