From bc54f3f3fed4dc3556df8c46cee6739d211b0eb2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 4 Sep 2016 14:34:28 +0200 Subject: [PATCH] patch 7.4.2322 Problem: Access memory beyond the end of the line. (Dominique Pelle) Solution: Adjust the cursor column. --- src/move.c | 1 + src/testdir/test_normal.vim | 9 +++++++++ src/version.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/move.c b/src/move.c index 6322acf98..a4d5f8299 100644 --- a/src/move.c +++ b/src/move.c @@ -2479,6 +2479,7 @@ onepage(int dir, long count) foldAdjustCursor(); #endif cursor_correct(); + check_cursor_col(); if (retval == OK) beginline(BL_SOL | BL_FIX); curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL); diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index ff6710218..98cb7754b 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -398,6 +398,15 @@ func! Test_normal14_page() bw! endfu +func! Test_normal14_page_eol() + 10new + norm oxxxxxxx + exe "norm 2\" + " check with valgrind that cursor is put back in column 1 + exe "norm 2\" + bw! +endfunc + func! Test_normal15_z_scroll_vert() " basic test for z commands that scroll the window call Setup_NewWindow() diff --git a/src/version.c b/src/version.c index 5628a9dce..155d9dda2 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2322, /**/ 2321, /**/ -- 2.50.1