]>
Commit | Line | Data |
---|---|---|
21b7d176 ER |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.112 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.112 | |
11 | Problem: Setting 'statusline' to "%!'asdf%' reads uninitialized memory. | |
12 | Solution: Check for NUL after %. | |
13 | Files: src/buffer.c | |
14 | ||
15 | ||
16 | *** ../vim-7.3.111/src/buffer.c 2010-10-27 16:17:56.000000000 +0200 | |
17 | --- src/buffer.c 2011-02-01 21:40:17.000000000 +0100 | |
18 | *************** | |
19 | *** 3364,3370 **** | |
20 | * or truncated if too long, fillchar is used for all whitespace. | |
21 | */ | |
22 | int | |
23 | ! build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, tabtab) | |
24 | win_T *wp; | |
25 | char_u *out; /* buffer to write into != NameBuff */ | |
26 | size_t outlen; /* length of out[] */ | |
27 | --- 3364,3371 ---- | |
28 | * or truncated if too long, fillchar is used for all whitespace. | |
29 | */ | |
30 | int | |
31 | ! build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, | |
32 | ! maxwidth, hltab, tabtab) | |
33 | win_T *wp; | |
34 | char_u *out; /* buffer to write into != NameBuff */ | |
35 | size_t outlen; /* length of out[] */ | |
36 | *************** | |
37 | *** 3474,3479 **** | |
38 | --- 3475,3482 ---- | |
39 | * Handle one '%' item. | |
40 | */ | |
41 | s++; | |
42 | + if (*s == NUL) /* ignore trailing % */ | |
43 | + break; | |
44 | if (*s == '%') | |
45 | { | |
46 | if (p + 1 >= out + outlen) | |
47 | *** ../vim-7.3.111/src/version.c 2011-02-01 18:01:06.000000000 +0100 | |
48 | --- src/version.c 2011-02-01 21:54:01.000000000 +0100 | |
49 | *************** | |
50 | *** 716,717 **** | |
51 | --- 716,719 ---- | |
52 | { /* Add new patch number below this line */ | |
53 | + /**/ | |
54 | + 112, | |
55 | /**/ | |
56 | ||
57 | -- | |
58 | Rule #1: Don't give somebody a tool that he's going to hurt himself with. | |
59 | ||
60 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
61 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
62 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
63 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |