From ec39e1e421101d2573ca5f9003238adfcd45dcd1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 18 Jan 2022 10:05:31 +0800 Subject: vim-patch:8.2.3611: crash when using CTRL-W f without finding a file name Problem: Crash when using CTRL-W f without finding a file name. Solution: Bail out when the file name length is zero. https://github.com/vim/vim/commit/615ddd5342b50a6878a907062aa471740bd9a847 --- src/nvim/path.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/path.c') diff --git a/src/nvim/path.c b/src/nvim/path.c index 674d67e21a..8b110d0ded 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1682,6 +1682,10 @@ char_u *find_file_name_in_path(char_u *ptr, size_t len, int options, long count, char_u *file_name; char_u *tofree = NULL; + if (len == 0) { + return NULL; + } + if ((options & FNAME_INCL) && *curbuf->b_p_inex != NUL) { tofree = (char_u *)eval_includeexpr((char *)ptr, len); if (tofree != NULL) { -- cgit