Re: Patch 9.0.0025

2022-07-03 Fir de Conversatie Bram Moolenaar


John Marriott wrote:

> On 02-July-2022 22:43, Bram Moolenaar wrote:
> > Patch 9.0.0025
> > Problem:Accessing beyond allocated memory when using the cmdline window 
> > in
> >  Ex mode.
> > Solution:   Use "*" instead of "'<,'>" for Visual mode.
> > Files:  src/ex_docmd.c, src/testdir/test_cmdline.vim
> >
> > // Special case: empty command uses "+":
> > !   //  "'<,'>mods" -> "mods *+
> > !   //  Use "*" instead of "'<,'>" to avoid the command getting
> > !   //  longer, in case is was allocated.
> > mch_memmove(orig_cmd, cmd_start, len);
> >
> In ex_docmd.c:
> :3123 s/in case*is *was allocated/in case*it *was allocated

Thanks.

-- 
Despite the cost of living, have you noticed how it remains so popular?

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220703121644.A61831C091A%40moolenaar.net.


Re: Patch 9.0.0025

2022-07-02 Fir de Conversatie John Marriott


On 02-July-2022 22:43, Bram Moolenaar wrote:

Patch 9.0.0025
Problem:Accessing beyond allocated memory when using the cmdline window in
 Ex mode.
Solution:   Use "*" instead of "'<,'>" for Visual mode.
Files:  src/ex_docmd.c, src/testdir/test_cmdline.vim
   
   		// Special case: empty command uses "+":

!   //  "'<,'>mods" -> "mods *+
!   //  Use "*" instead of "'<,'>" to avoid the command getting
!   //  longer, in case is was allocated.
mch_memmove(orig_cmd, cmd_start, len);


In ex_docmd.c:
:3123 s/in case*is *was allocated/in case*it *was allocated

Cheers
John

--
--
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/a944b1e9-cdcd-99fd-3e56-e5a3da7de2d1%40internode.on.net.


Patch 9.0.0025

2022-07-02 Fir de Conversatie Bram Moolenaar


Patch 9.0.0025
Problem:Accessing beyond allocated memory when using the cmdline window in
Ex mode.
Solution:   Use "*" instead of "'<,'>" for Visual mode.
Files:  src/ex_docmd.c, src/testdir/test_cmdline.vim


*** ../vim-9.0.0024/src/ex_docmd.c  2022-06-22 19:04:37.0 +0100
--- src/ex_docmd.c  2022-07-02 13:40:40.199988698 +0100
***
*** 3118,3126 
size_t len = STRLEN(cmd_start);
  
// Special case: empty command uses "+":
!   //  "'<,'>mods" -> "mods'<,'>+
mch_memmove(orig_cmd, cmd_start, len);
!   STRCPY(orig_cmd + len, "'<,'>+");
}
else
{
--- 3118,3128 
size_t len = STRLEN(cmd_start);
  
// Special case: empty command uses "+":
!   //  "'<,'>mods" -> "mods *+
!   //  Use "*" instead of "'<,'>" to avoid the command getting
!   //  longer, in case is was allocated.
mch_memmove(orig_cmd, cmd_start, len);
!   STRCPY(orig_cmd + len, " *+");
}
else
{
*** ../vim-9.0.0024/src/testdir/test_cmdline.vim2022-06-22 
19:02:12.0 +0100
--- src/testdir/test_cmdline.vim2022-07-02 13:39:41.468080762 +0100
***
*** 2103,2108 
--- 2103,2116 
call assert_equal(1, winnr('$'))
  endfunc
  
+ func Test_cmdwin_ex_mode_with_modifier()
+   " this was accessing memory after allocated text in Ex mode
+   new
+   call setline(1, ['some', 'text', 'lines'])
+   silent! call feedkeys("gQnormal vq:atopleft\\\", 'xt')
+   bwipe!
+ endfunc
+ 
  " test that ";" works to find a match at the start of the first line
  func Test_zero_line_search()
new
*** ../vim-9.0.0024/src/version.c   2022-07-02 12:08:12.813935667 +0100
--- src/version.c   2022-07-02 13:42:56.683779047 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 25,
  /**/

-- 
A day without sunshine is like, well, night.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220702124357.029D11C091A%40moolenaar.net.