diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 403f455b89..afd1d6d1a4 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3754,7 +3754,6 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs *allow_dirs = true; } reg_pat[i++] = '\\'; - reg_pat[i++] = *p; } break; #ifdef BACKSLASH_IN_FILENAME diff --git a/test/old/testdir/crash/heap_overflow_glob2regpat b/test/old/testdir/crash/heap_overflow_glob2regpat new file mode 100644 index 0000000000..8baf6f3253 Binary files /dev/null and b/test/old/testdir/crash/heap_overflow_glob2regpat differ diff --git a/test/old/testdir/test_crash.vim b/test/old/testdir/test_crash.vim index 80b0d3f722..4f13949fc6 100644 --- a/test/old/testdir/test_crash.vim +++ b/test/old/testdir/test_crash.vim @@ -226,6 +226,12 @@ func Test_crash1_3() call term_sendkeys(buf, args) call TermWait(buf, 150) + let file = 'crash/heap_overflow_glob2regpat' + let cmn_args = "%s -u NONE -i NONE -n -X -m -n -e -s -S %s -c ':qa!'" + let args = printf(cmn_args, vim, file) + call term_sendkeys(buf, args) + call TermWait(buf, 50) + " clean up exe buf .. "bw!"