Skip to content

Commit bc54f3f

Browse files
committed
patch 7.4.2322
Problem: Access memory beyond the end of the line. (Dominique Pelle) Solution: Adjust the cursor column.
1 parent dac1947 commit bc54f3f

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/move.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,7 @@ onepage(int dir, long count)
24792479
foldAdjustCursor();
24802480
#endif
24812481
cursor_correct();
2482+
check_cursor_col();
24822483
if (retval == OK)
24832484
beginline(BL_SOL | BL_FIX);
24842485
curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL);

src/testdir/test_normal.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,15 @@ func! Test_normal14_page()
398398
bw!
399399
endfu
400400

401+
func! Test_normal14_page_eol()
402+
10new
403+
norm oxxxxxxx
404+
exe "norm 2\<c-f>"
405+
" check with valgrind that cursor is put back in column 1
406+
exe "norm 2\<c-b>"
407+
bw!
408+
endfunc
409+
401410
func! Test_normal15_z_scroll_vert()
402411
" basic test for z commands that scroll the window
403412
call Setup_NewWindow()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2322,
766768
/**/
767769
2321,
768770
/**/

0 commit comments

Comments
 (0)