Patch 9.0.0212
Problem:    Invalid memory access when compiling :unlet.
Solution:   Don't read past the end of the line.
Files:      src/vim9cmds.c, src/testdir/test_vim9_cmd.vim


*** ../vim-9.0.0211/src/vim9cmds.c      2022-08-14 21:28:27.446201492 +0100
--- src/vim9cmds.c      2022-08-14 21:43:43.082516484 +0100
***************
*** 92,97 ****
--- 92,103 ----
      int
  check_vim9_unlet(char_u *name)
  {
+     if (*name == NUL)
+     {
+       semsg(_(e_argument_required_for_str), "unlet");
+       return FAIL;
+     }
+ 
      if (name[1] != ':' || vim_strchr((char_u *)"gwtb", *name) == NULL)
      {
        // "unlet s:var" is allowed in legacy script.
*** ../vim-9.0.0211/src/testdir/test_vim9_cmd.vim       2022-08-14 
21:28:27.446201492 +0100
--- src/testdir/test_vim9_cmd.vim       2022-08-14 21:43:36.726541151 +0100
***************
*** 1740,1751 ****
  
    lines =<< trim END
        def _()
-         s:0([], s:0)
          lockv
        enddef
        defcomp
    END
!   v9.CheckScriptFailure(lines, 'E179', 2)
  enddef
  
  def Test_substitute_expr()
--- 1740,1758 ----
  
    lines =<< trim END
        def _()
          lockv
        enddef
        defcomp
    END
!   v9.CheckScriptFailure(lines, 'E179', 1)
! 
!   lines =<< trim END
!       def T()
!         unlet
!       enddef
!       defcomp
!   END
!   v9.CheckScriptFailure(lines, 'E179', 1)
  enddef
  
  def Test_substitute_expr()
*** ../vim-9.0.0211/src/version.c       2022-08-14 21:28:27.446201492 +0100
--- src/version.c       2022-08-14 21:44:43.442292545 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     212,
  /**/

-- 
'I generally avoid temptation unless I can't resist it."
                -- Mae West

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220814204638.D707E1C04B1%40moolenaar.net.

Raspunde prin e-mail lui