aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/path.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-18 10:05:31 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-01-18 10:05:31 +0800
commitec39e1e421101d2573ca5f9003238adfcd45dcd1 (patch)
tree5c8a2f3b2a89d7ec13140d10998c742d28aa7820 /src/nvim/path.c
parent0a65d821fcc3fe1cab52b4102f2a55b7aa89df03 (diff)
downloadrneovim-ec39e1e421101d2573ca5f9003238adfcd45dcd1.tar.gz
rneovim-ec39e1e421101d2573ca5f9003238adfcd45dcd1.tar.bz2
rneovim-ec39e1e421101d2573ca5f9003238adfcd45dcd1.zip
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
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r--src/nvim/path.c4
1 files changed, 4 insertions, 0 deletions
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) {