4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Invalid memory read with visual mode "r". (Dominique Pelle)
12 Solution: Make sure the cursor position is valid. Don't check the cursor
13 position but the position being used. And make sure we get the
15 Files: src/misc2.c, src/ops.c
18 *** ../vim-7.2.278/src/misc2.c 2009-05-16 21:06:36.000000000 +0200
19 --- src/misc2.c 2009-11-03 16:43:10.000000000 +0100
22 || ((ve_flags & VE_ONEMORE) && wcol < MAXCOL)
25 ! line = ml_get_curline();
30 || ((ve_flags & VE_ONEMORE) && wcol < MAXCOL)
33 ! line = ml_get_buf(curbuf, pos->lnum, FALSE);
42 ! /* prevent cursor from moving on the trail byte */
52 ! /* prevent from moving onto a trail byte */
58 *** ../vim-7.2.278/src/ops.c 2009-09-30 15:15:33.000000000 +0200
59 --- src/ops.c 2009-11-03 15:18:50.000000000 +0100
63 bd.is_MAX = (curwin->w_curswant == MAXCOL);
64 for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum)
66 + curwin->w_cursor.col = 0; /* make sure cursor position is valid */
67 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE);
68 if (bd.textlen == 0 && (!virtual_op || bd.is_MAX))
69 continue; /* nothing to replace */
76 + vpos.lnum = curwin->w_cursor.lnum;
77 getvpos(&vpos, oap->start_vcol);
78 bd.startspaces += vpos.coladd;
82 * initial coladd offset as part of "startspaces" */
85 ! linenr_T lnum = curwin->w_cursor.lnum;
87 ! curwin->w_cursor.lnum = linenr;
88 (void)getvpos(&vpos, oap->start_vcol);
89 - curwin->w_cursor.lnum = lnum;
94 * initial coladd offset as part of "startspaces" */
98 (void)getvpos(&vpos, oap->start_vcol);
102 *** ../vim-7.2.278/src/version.c 2009-11-03 16:29:48.000000000 +0100
103 --- src/version.c 2009-11-03 16:41:53.000000000 +0100
107 { /* Add new patch number below this line */
113 BEDEVERE: How do you know so much about swallows?
114 ARTHUR: Well you have to know these things when you're a king, you know.
115 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
117 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
118 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
119 \\\ download, build and distribute -- http://www.A-A-P.org ///
120 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///