summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-11 11:42:28 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-11 11:42:28 +0100
commita59f2dfd0cf9ee1a584d3de5b7c2d47648e79060 (patch)
tree7983fe4811bf949c7a7ca174775428a096a7e20d /src/buffer.c
parentead241538cdd26cbf02599b6e23cd8baeafbcbb2 (diff)
downloadvim-git-a59f2dfd0cf9ee1a584d3de5b7c2d47648e79060.tar.gz
patch 8.2.4938: crash when matching buffer with invalid patternv8.2.4938
Problem: Crash when matching buffer with invalid pattern. Solution: Check for NULL regprog.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 35711f5fe..dfdb0c430 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2932,7 +2932,7 @@ buflist_match(
// First try the short file name, then the long file name.
match = fname_match(rmp, buf->b_sfname, ignore_case);
- if (match == NULL)
+ if (match == NULL && rmp->regprog != NULL)
match = fname_match(rmp, buf->b_ffname, ignore_case);
return match;