aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-11-24 03:58:44 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2021-11-24 05:34:20 +0000
commitdac52e6d044d27cd6d51fdde2fa3be3f9dba11a4 (patch)
treedf7f5b417c5d8124e35651b1f81c9d925e4320ce /src/nvim/search.c
parentc366c944c2d2f46862f8d3a660e52f2735f816ae (diff)
downloadrneovim-dac52e6d044d27cd6d51fdde2fa3be3f9dba11a4.tar.gz
rneovim-dac52e6d044d27cd6d51fdde2fa3be3f9dba11a4.tar.bz2
rneovim-dac52e6d044d27cd6d51fdde2fa3be3f9dba11a4.zip
vim-patch:8.2.2465: using freed memory in :psearch
Problem: Using freed memory in :psearch. (houyunsong) Solution: Check the current window is still valid. Fix flaky test. https://github.com/vim/vim/commit/92bb83e41ca42d0d00d21753810d92485c808a50 Test_cursorhold_insert timer's 100ms delay was already LoadAdjusted, but change to 200ms (still LoadAdjust) to match Vim anyway.
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 2e45a8f509..f47315705c 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -5248,6 +5248,9 @@ search_line:
if (depth == -1) {
// match in current file
if (l_g_do_tagpreview != 0) {
+ if (!win_valid(curwin_save)) {
+ break;
+ }
if (!GETFILE_SUCCESS(getfile(curwin_save->w_buffer->b_fnum, NULL,
NULL, true, lnum, false))) {
break; // failed to jump to file