From 3b6d57f2ce87dc5a4b1a50e1b0fd2aeaf72faae2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 1 Nov 2020 21:56:40 +0100 Subject: patch 8.2.1939: invalid memory access in Ex mode with global command Problem: Invalid memory access in Ex mode with global command. Solution: Make sure the cursor is on a valid line. (closes #7238) --- src/move.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/move.c') diff --git a/src/move.c b/src/move.c index 20a34e8e5..cd0af3e64 100644 --- a/src/move.c +++ b/src/move.c @@ -196,6 +196,7 @@ update_topline(void) // the cursor line. if (!screen_valid(TRUE) || curwin->w_height == 0) { + check_cursor_lnum(); curwin->w_topline = curwin->w_cursor.lnum; curwin->w_botline = curwin->w_topline; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; -- cgit v1.2.1