diff src/normal.c @ 10110:cfb38b57d407 v7.4.2326

commit https://github.com/vim/vim/commit/d5824ce1b5491df7d2eb0b66189d366fa67b4585 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 4 20:35:01 2016 +0200 patch 7.4.2326 Problem: Illegal memory access when Visual selection starts in invalid position. (Dominique Pelle) Solution: Correct position when needed.
author Christian Brabandt <cb@256bit.org>
date Sun, 04 Sep 2016 20:45:05 +0200
parents 72e4b7f90465
children 4647267906cc
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -9451,7 +9451,10 @@ get_op_vcol(
 #ifdef FEAT_MBYTE
     /* prevent from moving onto a trail byte */
     if (has_mbyte)
+    {
+	check_pos(curwin->w_buffer, &oap->end);
 	mb_adjustpos(curwin->w_buffer, &oap->end);
+    }
 #endif
 
     getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol);