From: Bram Moolenaar Date: Tue, 15 Feb 2011 13:24:46 +0000 (+0100) Subject: updated for version 7.3.121 X-Git-Tag: v7.3.121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b75d09d42b4fb277071afd166c8a394a8b6e0fda;p=vim updated for version 7.3.121 Problem: Complicated 'statusline' causes a crash. (Christian Brabandt) Solution: Check that the number of items is not too big. --- 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; diff --git a/src/version.c b/src/version.c index cbb1ac722..97170e627 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 121, /**/ 120, /**/