Mercurial > vim
comparison src/move.c @ 22782:53b996eb5e76 v8.2.1939
patch 8.2.1939: invalid memory access in Ex mode with global command
Commit: https://github.com/vim/vim/commit/3b6d57f2ce87dc5a4b1a50e1b0fd2aeaf72faae2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 1 21:56:40 2020 +0100
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 https://github.com/vim/vim/issues/7238)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 Nov 2020 22:00:04 +0100 |
parents | 3351d2cd3f1f |
children | 38324d4f1c94 |
comparison
equal
deleted
inserted
replaced
22781:d67c6dd3d99b | 22782:53b996eb5e76 |
---|---|
194 | 194 |
195 // If there is no valid screen and when the window height is zero just use | 195 // If there is no valid screen and when the window height is zero just use |
196 // the cursor line. | 196 // the cursor line. |
197 if (!screen_valid(TRUE) || curwin->w_height == 0) | 197 if (!screen_valid(TRUE) || curwin->w_height == 0) |
198 { | 198 { |
199 check_cursor_lnum(); | |
199 curwin->w_topline = curwin->w_cursor.lnum; | 200 curwin->w_topline = curwin->w_cursor.lnum; |
200 curwin->w_botline = curwin->w_topline; | 201 curwin->w_botline = curwin->w_topline; |
201 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; | 202 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; |
202 curwin->w_scbind_pos = 1; | 203 curwin->w_scbind_pos = 1; |
203 return; | 204 return; |