Problem: Accessing invalid memory with "it". (Dominique Pelle)
Solution: Avoid going over the end of the line. (Christian Brabandt,
closes #2532)
&& pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
&& pos->col < MAXCOL - 2)
{
- ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
- if (*ptr == NUL)
+ ptr = ml_get_buf(buf, pos->lnum, FALSE);
+ if ((int)STRLEN(ptr) < pos->col)
start_char_len = 1;
else
- start_char_len = (*mb_ptr2len)(ptr);
+ start_char_len = (*mb_ptr2len)(ptr + pos->col);
}
#endif
else
call assert_equal(3 , match('abc', '\zs', 3, 1))
call assert_equal(-1, match('abc', '\zs', 4, 1))
endfunc
+
+" This was causing an illegal memory access
+func Test_inner_tag()
+ new
+ norm ixxx
+ call feedkeys("v", 'xt')
+ insert
+x
+x
+.
+ norm it
+ q!
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1486,
/**/
1485,
/**/