vim-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 vim/vim#6827)
997cd1a17f
This commit is contained in:
Jan Edmund Lazo
2020-10-17 11:05:33 -04:00
parent afd4888c6a
commit b9fe30cac2
2 changed files with 18 additions and 4 deletions

View File

@@ -5073,7 +5073,7 @@ static void vgr_jump_to_match(qf_info_T *qi, int forceit, int *redraw_for_dummy,
static bool existing_swapfile(const buf_T *buf)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
if (buf->b_ml.ml_mfp != NULL) {
if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) {
const char_u *const fname = buf->b_ml.ml_mfp->mf_fname;
const size_t len = STRLEN(fname);