summaryrefslogtreecommitdiff
path: root/src/move.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-01 21:56:40 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-01 21:56:40 +0100
commit3b6d57f2ce87dc5a4b1a50e1b0fd2aeaf72faae2 (patch)
tree7017780a40d43304cabf62100b0c52df6cea6977 /src/move.c
parenta46765a79745ff27b4a44659fb8389519c961977 (diff)
downloadvim-git-3b6d57f2ce87dc5a4b1a50e1b0fd2aeaf72faae2.tar.gz
patch 8.2.1939: invalid memory access in Ex mode with global commandv8.2.1939
Problem: Invalid memory access in Ex mode with global command. Solution: Make sure the cursor is on a valid line. (closes #7238)
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c1
1 files changed, 1 insertions, 0 deletions
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;