Permalink
Browse files

patch 8.0.0339: illegal memory access with vi'

Problem:    Illegal memory access with vi'
Solution:   For quoted text objects bail out if the Visual area spans more
            than one line.
  • Loading branch information...
brammool committed Feb 18, 2017
1 parent 8034520 commit 46522af72424c7fadfa7a4cbba3dd21b82d19131
Showing with 13 additions and 0 deletions.
  1. +4 −0 src/search.c
  2. +7 −0 src/testdir/test_visual.vim
  3. +2 −0 src/version.c
View
@@ -4357,6 +4357,10 @@ current_quote(
/* Correct cursor when 'selection' is exclusive */
if (VIsual_active)
{
+ /* this only works within one line */
+ if (VIsual.lnum != curwin->w_cursor.lnum)
+ return FALSE;
+
vis_bef_curs = lt(VIsual, curwin->w_cursor);
if (*p_sel == 'e' && vis_bef_curs)
dec_cursor();
@@ -43,3 +43,10 @@ func Test_Visual_vapo()
normal vapo
bwipe!
endfunc
+
+func Test_Visual_inner_quote()
+ new
+ normal oxX
+ normal vki'
+ bwipe!
+endfunc
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 339,
/**/
338,
/**/

0 comments on commit 46522af

Please sign in to comment.