4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Accessing uninitialized memory when displaying the fold column.
12 Solution: Add a NUL to the extra array. (Dominique Pelle). Also do this in
13 a couple of other situations.
17 *** ../vim-7.1.053/src/screen.c Mon Jul 30 21:59:50 2007
18 --- src/screen.c Sun Aug 5 16:10:53 2007
22 char_u extra[18]; /* "%ld" and 'fdc' must fit in here */
23 int n_extra = 0; /* number of extra chars */
24 ! char_u *p_extra = NULL; /* string of extra chars */
25 int c_extra = NUL; /* extra chars, all the same */
26 int extra_attr = 0; /* attributes when n_extra != 0 */
27 static char_u *at_end_str = (char_u *)""; /* used for p_extra when
30 char_u extra[18]; /* "%ld" and 'fdc' must fit in here */
31 int n_extra = 0; /* number of extra chars */
32 ! char_u *p_extra = NULL; /* string of extra chars, plus NUL */
33 int c_extra = NUL; /* extra chars, all the same */
34 int extra_attr = 0; /* attributes when n_extra != 0 */
35 static char_u *at_end_str = (char_u *)""; /* used for p_extra when
38 if (cmdwin_type != 0 && wp == curwin)
40 /* Draw the cmdline character. */
41 - *extra = cmdwin_type;
45 char_attr = hl_attr(HLF_AT);
49 if (cmdwin_type != 0 && wp == curwin)
51 /* Draw the cmdline character. */
53 ! c_extra = cmdwin_type;
54 char_attr = hl_attr(HLF_AT);
60 fill_foldcolumn(extra, wp, FALSE, lnum);
61 n_extra = wp->w_p_fdc;
63 + p_extra[n_extra] = NUL;
65 char_attr = hl_attr(HLF_FC);
69 * Get the next character to put on the screen.
72 ! * The 'extra' array contains the extra stuff that is inserted to
73 ! * represent special characters (non-printable stuff). When all
74 ! * characters are the same, c_extra is used.
75 * For the '$' of the 'list' option, n_extra == 1, p_extra == "".
79 * Get the next character to put on the screen.
82 ! * The "p_extra" points to the extra stuff that is inserted to
83 ! * represent special characters (non-printable stuff) and other
84 ! * things. When all characters are the same, c_extra is used.
85 ! * "p_extra" must end in a NUL to avoid mb_ptr2len() reads past
86 ! * "p_extra[n_extra]".
87 * For the '$' of the 'list' option, n_extra == 1, p_extra == "".
92 * a '<' in the first column. */
93 if (n_skip > 0 && mb_l > 1)
100 if (area_attr == 0 && search_attr == 0)
103 * a '<' in the first column. */
104 if (n_skip > 0 && mb_l > 1)
109 if (area_attr == 0 && search_attr == 0)
115 off = LineOffset[row] + col;
116 ! while (*ptr != NUL && col < screen_Columns
117 ! && (len < 0 || (int)(ptr - text) < len))
124 off = LineOffset[row] + col;
125 ! while (col < screen_Columns
126 ! && (len < 0 || (int)(ptr - text) < len)
131 *** ../vim-7.1.053/src/version.c Sun Aug 5 19:20:04 2007
132 --- src/version.c Sun Aug 5 20:07:47 2007
136 { /* Add new patch number below this line */
142 From "know your smileys":
145 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
146 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
147 \\\ download, build and distribute -- http://www.A-A-P.org ///
148 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///