diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-17 19:36:04 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-17 19:36:04 +0200 |
commit | da697645d5917eb3d4168c06c3442bef9fb746bf (patch) | |
tree | 7f1801164ab1ef571612b16b1b5c9a532a7c768f /src/fold.c | |
parent | 08e51f446bd4bf1a0342c471163b1ed083e9eedb (diff) |
patch 8.2.1702: crash when using undo after deleting folded linesv8.2.1702
Problem: Crash when using undo after deleting folded lines.
Solution: Check for NULL pointer. (closes #6968)
Diffstat (limited to 'src/fold.c')
-rw-r--r-- | src/fold.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fold.c b/src/fold.c index 5c55b0777b..8a904f64c6 100644 --- a/src/fold.c +++ b/src/fold.c @@ -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; } |