Patch 8.0.1433
Problem: Illegal memory access after undo. (Dominique Pelle)
Solution: Avoid the column becomes negative. (Christian Brabandt,
closes #2533)
Files: src/mbyte.c, src/testdir/test_undo.vim
*** ../vim-8.0.1432/src/mbyte.c 2017-11-27 22:48:57.909206815 +0100
--- src/mbyte.c 2018-01-27 20:57:59.795745082 +0100
***************
*** 1784,1789 ****
--- 1784,1790 ----
* Convert a UTF-8 byte sequence to a wide character.
* If the sequence is illegal or truncated by a NUL the first byte is
* returned.
+ * For an overlong sequence this may return zero.
* Does not include composing characters, of course.
*/
int
***************
*** 4112,4118 ****
)
{
p = ml_get_buf(buf, lp->lnum, FALSE);
! lp->col -= (*mb_head_off)(p, p + lp->col);
#ifdef FEAT_VIRTUALEDIT
/* Reset "coladd" when the cursor would be on the right half of a
* double-wide character. */
--- 4113,4122 ----
)
{
p = ml_get_buf(buf, lp->lnum, FALSE);
! if (*p == NUL || (int)STRLEN(p) < lp->col)
! lp->col = 0;
! else
! lp->col -= (*mb_head_off)(p, p + lp->col);
#ifdef FEAT_VIRTUALEDIT
/* Reset "coladd" when the cursor would be on the right half of a
* double-wide character. */
*** ../vim-8.0.1432/src/testdir/test_undo.vim 2017-11-11 23:37:04.192694223
+0100
--- src/testdir/test_undo.vim 2018-01-27 20:53:04.973855995 +0100
***************
*** 350,352 ****
--- 350,361 ----
only!
let @a=''
endfunc
+
+ " This used to cause an illegal memory access
+ func Test_undo_append()
+ new
+ call feedkeys("axx\<Esc>v", 'xt')
+ undo
+ norm o
+ quit
+ endfunc
*** ../vim-8.0.1432/src/version.c 2018-01-27 11:52:08.717774798 +0100
--- src/version.c 2018-01-27 21:01:11.562375432 +0100
***************
*** 773,774 ****
--- 773,776 ----
{ /* Add new patch number below this line */
+ /**/
+ 1433,
/**/
--
hundred-and-one symptoms of being an internet addict:
261. You find diskettes in your pockets when doing laundry.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.