From: Bram Moolenaar Date: Tue, 1 Feb 2011 20:55:01 +0000 (+0100) Subject: updated for version 7.3.112 X-Git-Tag: v7.3.112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d87f516f2133dfadba1055c3009672ca96b84bf;p=vim updated for version 7.3.112 Problem: Setting 'statusline' to "%!'asdf%' reads uninitialized memory. Solution: Check for NUL after %. --- diff --git a/src/buffer.c b/src/buffer.c index a7290aebb..e91b7c847 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -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) diff --git a/src/version.c b/src/version.c index cc3174f31..ff5db0aa0 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 */ +/**/ + 112, /**/ 111, /**/