0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1557: crash in :vimgrep when started as "vim -n"

Problem:    Crash in :vimgrep when started as "vim -n". (Raul Segura)
Solution:   Check mfp pointer. (Yegappan Lakshmanan, closes #6827)
This commit is contained in:
Bram Moolenaar
2020-08-31 22:16:08 +02:00
parent 39f7aa3c31
commit 997cd1a17f
3 changed files with 18 additions and 1 deletions

View File

@@ -6022,7 +6022,7 @@ vgr_process_args(
static int
existing_swapfile(buf_T *buf)
{
if (buf->b_ml.ml_mfp != NULL)
if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
{
char_u *fname = buf->b_ml.ml_mfp->mf_fname;
size_t len = STRLEN(fname);