Christian Brabandt wrote:
> I accidentally set my stl to '%#Normal' (note the missing trailing '#').
>
> This resulted in some garbish characters in my statusline. Running under
> valgrind, I see this error:
>
> ==20390== Invalid read of size 1
> ==20390== at 0x40F07D: build_stl_str_hl (buffer.c:3603)
> ==20390== by 0x517F30: win_redr_custom (screen.c:6760)
> ==20390== by 0x51837D: redraw_custom_statusline (screen.c:6547)
> ==20390== by 0x51CD38: showruler (screen.c:10178)
> ==20390== by 0x579007: main_loop (main.c:1264)
> ==20390== by 0x409278: main (main.c:1020)
> ==20390== Address 0x7baa4d9 is 0 bytes after a block of size 9 alloc'd
> ==20390== at 0x4C2A2DB: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==20390== by 0x4B92D4: lalloc (misc2.c:929)
> ==20390== by 0x4B9C1D: vim_strsave (misc2.c:828)
> ==20390== by 0x517EED: win_redr_custom (screen.c:6759)
> ==20390== by 0x51837D: redraw_custom_statusline (screen.c:6547)
> ==20390== by 0x51CD38: showruler (screen.c:10178)
> ==20390== by 0x579007: main_loop (main.c:1264)
> ==20390== by 0x409278: main (main.c:1020)
>
> Here is a small patch:
>
> diff --git a/src/buffer.c b/src/buffer.c
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -4062,7 +4062,8 @@
> item[curitem].minwid = -syn_namen2id(t, (int)(s - t));
> curitem++;
> }
> - ++s;
> + if (*s != NUL)
> + s++;
> continue;
> }
Thanks for the patch!
--
ARTHUR: No, hang on! Just answer the five questions ...
GALAHAD: Three questions ...
ARTHUR: Three questions ... And we shall watch ... and pray.
"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/ \\\
\\\ 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/groups/opt_out.