0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.1702: crash when using undo after deleting folded lines

Problem:    Crash when using undo after deleting folded lines.
Solution:   Check for NULL pointer. (closes #6968)
This commit is contained in:
Bram Moolenaar
2020-09-17 19:36:04 +02:00
parent 08e51f446b
commit da697645d5
3 changed files with 23 additions and 2 deletions

View File

@@ -2422,8 +2422,8 @@ foldUpdateIEMSRecurse(
&& flp->lvl > 0)
{
(void)foldFind(gap, startlnum - 1, &fp);
if (fp >= ((fold_T *)gap->ga_data) + gap->ga_len
|| fp->fd_top >= startlnum)
if (fp != NULL && (fp >= ((fold_T *)gap->ga_data) + gap->ga_len
|| fp->fd_top >= startlnum))
fp = NULL;
}