]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.121 v7.3.121
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Feb 2011 13:24:46 +0000 (14:24 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Feb 2011 13:24:46 +0000 (14:24 +0100)
Problem:    Complicated 'statusline' causes a crash. (Christian Brabandt)
Solution:   Check that the number of items is not too big.

src/buffer.c
src/version.c

index e91b7c847e02a3450a0d8cc812763ea517245ae0..420b5ea914f5ca3d858e9ea413a12f6c68cc5c00 100644 (file)
@@ -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;
 
index cbb1ac7225a4cc6142a890bc956bfd198c9a925e..97170e6274e3aea379edf37fb8e717ec6be7f3ca 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    121,
 /**/
     120,
 /**/