diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-11 19:07:31 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-05-11 19:09:21 +0800 |
commit | 0019886a84c7dfdaf452c8a715f26eb87c697b1b (patch) | |
tree | 5458a5f5e7028573cf5980472e170d3f72200d4d /src/nvim/buffer.c | |
parent | 96a125b2076f75d4273acd1ddcf66e76190b0857 (diff) | |
download | rneovim-0019886a84c7dfdaf452c8a715f26eb87c697b1b.tar.gz rneovim-0019886a84c7dfdaf452c8a715f26eb87c697b1b.tar.bz2 rneovim-0019886a84c7dfdaf452c8a715f26eb87c697b1b.zip |
vim-patch:8.2.4901: NULL pointer access when using invalid pattern
Problem: NULL pointer access when using invalid pattern.
Solution: Check for failed regexp program.
https://github.com/vim/vim/commit/8e4b76da1d7e987d43ca960dfbc372d1c617466f
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index ab804cc42f..f9ad16e357 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2387,7 +2387,7 @@ static char_u *fname_match(regmatch_T *rmp, char_u *name, bool ignore_case) rmp->rm_ic = p_fic || ignore_case; if (vim_regexec(rmp, name, (colnr_T)0)) { match = name; - } else { + } else if (rmp->regprog != NULL) { // Replace $(HOME) with '~' and try matching again. p = home_replace_save(NULL, name); if (vim_regexec(rmp, p, (colnr_T)0)) { |