1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Using NULL buffer pointer in a window.
12 Solution: Check for w_buffer being NULL in more places. (Bjorn Winckler)
13 Files: src/ex_cmds.c, src/quickfix.c, src/window.c
16 *** ../vim-7.3.389/src/ex_cmds.c 2011-11-30 17:01:55.000000000 +0100
17 --- src/ex_cmds.c 2011-12-30 14:59:57.000000000 +0100
21 (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
24 + /* Autocommands may open a new window and leave oldwin open
25 + * which leads to crashes since the above call sets
26 + * oldwin->w_buffer to NULL. */
27 + if (curwin != oldwin && oldwin != aucmd_win
28 + && win_valid(oldwin) && oldwin->w_buffer == NULL)
29 + win_close(oldwin, FALSE);
32 if (aborting()) /* autocmds may abort script processing */
34 *** ../vim-7.3.389/src/quickfix.c 2011-08-10 18:36:49.000000000 +0200
35 --- src/quickfix.c 2011-12-30 14:45:19.000000000 +0100
41 ! return (buf->b_p_bt[0] == 'q');
49 ! return buf != NULL && buf->b_p_bt[0] == 'q';
58 ! return (buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
59 ! || buf->b_p_bt[0] == 'a';
67 ! return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
68 ! || buf->b_p_bt[0] == 'a');
77 ! return (buf->b_p_bt[0] == 'n');
85 ! return buf != NULL && buf->b_p_bt[0] == 'n';
89 *** ../vim-7.3.389/src/window.c 2011-09-14 14:43:21.000000000 +0200
90 --- src/window.c 2011-12-30 14:44:18.000000000 +0100
94 /* When closing the help window, try restoring a snapshot after closing
95 * the window. Otherwise clear the snapshot, it's now invalid. */
96 ! if (win->w_buffer->b_help)
99 clear_snapshot(curtab, SNAP_HELP_IDX);
102 /* When closing the help window, try restoring a snapshot after closing
103 * the window. Otherwise clear the snapshot, it's now invalid. */
104 ! if (win->w_buffer != NULL && win->w_buffer->b_help)
107 clear_snapshot(curtab, SNAP_HELP_IDX);
112 /* Free independent synblock before the buffer is freed. */
113 ! reset_synblock(win);
117 * Close the link to the buffer.
119 ! close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
121 /* Autocommands may have closed the window already, or closed the only
122 * other window or moved to another tab page. */
126 /* Free independent synblock before the buffer is freed. */
127 ! if (win->w_buffer != NULL)
128 ! reset_synblock(win);
132 * Close the link to the buffer.
134 ! if (win->w_buffer != NULL)
135 ! close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
137 /* Autocommands may have closed the window already, or closed the only
138 * other window or moved to another tab page. */
139 *** ../vim-7.3.389/src/version.c 2011-12-30 14:14:16.000000000 +0100
140 --- src/version.c 2011-12-30 14:38:39.000000000 +0100
144 { /* Add new patch number below this line */
150 There can't be a crisis today, my schedule is already full.
152 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
153 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
154 \\\ an exciting new programming language -- http://www.Zimbu.org ///
155 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///