0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.3.112

Problem:    Setting 'statusline' to "%!'asdf%' reads uninitialized memory.
Solution:   Check for NUL after %.
This commit is contained in:
Bram Moolenaar
2011-02-01 21:55:01 +01:00
parent 6145285c90
commit 1d87f516f2
2 changed files with 6 additions and 1 deletions

View File

@@ -3364,7 +3364,8 @@ free_titles()
* or truncated if too long, fillchar is used for all whitespace. * or truncated if too long, fillchar is used for all whitespace.
*/ */
int 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; win_T *wp;
char_u *out; /* buffer to write into != NameBuff */ char_u *out; /* buffer to write into != NameBuff */
size_t outlen; /* length of out[] */ 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. * Handle one '%' item.
*/ */
s++; s++;
if (*s == NUL) /* ignore trailing % */
break;
if (*s == '%') if (*s == '%')
{ {
if (p + 1 >= out + outlen) if (p + 1 >= out + outlen)

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
112,
/**/ /**/
111, 111,
/**/ /**/