Patch 9.0.1143
Problem:    Invalid memory access with bad 'statusline' value.
Solution:   Avoid going over the NUL at the end.
Files:      src/buffer.c, src/testdir/test_statusline.vim


*** ../vim-9.0.1142/src/buffer.c        2023-01-02 16:54:48.928860870 +0000
--- src/buffer.c        2023-01-04 14:31:01.402102010 +0000
***************
*** 4617,4622 ****
--- 4617,4624 ----
  #endif
        if (vim_strchr(STL_ALL, *s) == NULL)
        {
+           if (*s == NUL)  // can happen with "%0"
+               break;
            s++;
            continue;
        }
*** ../vim-9.0.1142/src/testdir/test_statusline.vim     2022-12-15 
13:14:17.415527399 +0000
--- src/testdir/test_statusline.vim     2023-01-04 14:14:04.447436970 +0000
***************
*** 440,445 ****
--- 440,452 ----
    set splitbelow&
  endfunc
  
+ func Test_statusline_trailing_percent_zero()
+   " this was causing illegal memory access
+   set laststatus=2 stl=%!%0
+   call assert_fails('redraw', 'E15: Invalid expression: "%0"')
+   set laststatus& stl&
+ endfunc
+ 
  func Test_statusline_visual()
    func CallWordcount()
      call wordcount()
*** ../vim-9.0.1142/src/version.c       2023-01-04 13:16:16.555907760 +0000
--- src/version.c       2023-01-04 14:09:16.234367767 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1143,
  /**/

-- 
ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot.
        King of all Britons, defeator of the Saxons, sovereign of all England!
   [Pause]
SOLDIER: Get away!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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/20230104143214.3B6F31C0865%40moolenaar.net.

Raspunde prin e-mail lui