summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-02-15 14:24:46 +0100
committerBram Moolenaar <Bram@vim.org>2011-02-15 14:24:46 +0100
commitb75d09d42b4fb277071afd166c8a394a8b6e0fda (patch)
tree3632ae939e6c5448c4bc6b17d6df3a9637653725 /src/buffer.c
parentc41fc713bafb6940761261804407d7df3be3d41c (diff)
downloadvim-git-b75d09d42b4fb277071afd166c8a394a8b6e0fda.tar.gz
updated for version 7.3.121v7.3.121
Problem: Complicated 'statusline' causes a crash. (Christian Brabandt) Solution: Check that the number of items is not too big.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index e91b7c847..420b5ea91 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3460,6 +3460,18 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar,
prevchar_isitem = FALSE;
for (s = usefmt; *s; )
{
+ if (curitem == STL_MAX_ITEM)
+ {
+ /* There are too many items. Add the error code to the statusline
+ * to give the user a hint about what went wrong. */
+ if (p + 6 < out + outlen)
+ {
+ mch_memmove(p, " E541", (size_t)5);
+ p += 5;
+ }
+ break;
+ }
+
if (*s != NUL && *s != '%')
prevchar_isflag = prevchar_isitem = FALSE;