0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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.
This commit is contained in:
Bram Moolenaar
2022-05-07 11:28:06 +01:00
parent 801c3c1dbe
commit 8e4b76da1d
3 changed files with 10 additions and 1 deletions

View File

@@ -2957,7 +2957,7 @@ fname_match(
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);