]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.112 v7.3.112
authorBram Moolenaar <Bram@vim.org>
Tue, 1 Feb 2011 20:55:01 +0000 (21:55 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 1 Feb 2011 20:55:01 +0000 (21:55 +0100)
Problem:    Setting 'statusline' to "%!'asdf%' reads uninitialized memory.
Solution:   Check for NUL after %.

src/buffer.c
src/version.c

index a7290aebb1d1586ce78025db795c52232f7b7816..e91b7c847e02a3450a0d8cc812763ea517245ae0 100644 (file)
@@ -3364,7 +3364,8 @@ free_titles()
  * or truncated if too long, fillchar is used for all whitespace.
  */
     int
-build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, tabtab)
+build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar,
+                                                     maxwidth, hltab, tabtab)
     win_T      *wp;
     char_u     *out;           /* buffer to write into != NameBuff */
     size_t     outlen;         /* length of out[] */
@@ -3474,6 +3475,8 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
         * Handle one '%' item.
         */
        s++;
+       if (*s == NUL)  /* ignore trailing % */
+           break;
        if (*s == '%')
        {
            if (p + 1 >= out + outlen)
index cc3174f3127af8b0c60fc8ca25e9ed083095529a..ff5db0aa048138d9e922442b087ae7a1899fa1eb 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    112,
 /**/
     111,
 /**/