From e8bc23db62c37e91d0c277b4bddf652db6a9d5f1 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Mon, 4 Mar 2024 21:25:15 -0800 Subject: vim-patch:9.1.0149: null pointer member access when accessing 'winfixbuf' property Problem: qf_goto_win_with_qfl_file may check if prevwin has 'winfixbuf' set without checking if it's valid first. Solution: Reverse the condition. Add a test, a modeline, and a missing CheckFeature. (Searn Dewar) closes: vim/vim#14140 https://github.com/vim/vim/commit/5131f224da93f2e042a4b22545ef62b1b2ab8460 Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index a88b781f32..3dd4e35f65 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2699,7 +2699,7 @@ static void qf_goto_win_with_qfl_file(int qf_fnum) // Didn't find it, go to the window before the quickfix // window, unless 'switchbuf' contains 'uselast': in this case we // try to jump to the previously used window first. - if ((swb_flags & SWB_USELAST) && !prevwin->w_p_wfb && win_valid(prevwin)) { + if ((swb_flags & SWB_USELAST) && win_valid(prevwin) && !prevwin->w_p_wfb) { win = prevwin; } else if (altwin != NULL) { win = altwin; -- cgit