]>
Commit | Line | Data |
---|---|---|
c6060300 MT |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.390 | |
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.390 | |
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 | |
14 | ||
15 | ||
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 | |
18 | *************** | |
19 | *** 3390,3395 **** | |
20 | --- 3390,3402 ---- | |
21 | (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD); | |
22 | ||
23 | #ifdef FEAT_AUTOCMD | |
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); | |
30 | + | |
31 | # ifdef FEAT_EVAL | |
32 | if (aborting()) /* autocmds may abort script processing */ | |
33 | { | |
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 | |
36 | *************** | |
37 | *** 2675,2681 **** | |
38 | bt_quickfix(buf) | |
39 | buf_T *buf; | |
40 | { | |
41 | ! return (buf->b_p_bt[0] == 'q'); | |
42 | } | |
43 | ||
44 | /* | |
45 | --- 2675,2681 ---- | |
46 | bt_quickfix(buf) | |
47 | buf_T *buf; | |
48 | { | |
49 | ! return buf != NULL && buf->b_p_bt[0] == 'q'; | |
50 | } | |
51 | ||
52 | /* | |
53 | *************** | |
54 | *** 2686,2693 **** | |
55 | bt_nofile(buf) | |
56 | buf_T *buf; | |
57 | { | |
58 | ! return (buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') | |
59 | ! || buf->b_p_bt[0] == 'a'; | |
60 | } | |
61 | ||
62 | /* | |
63 | --- 2686,2693 ---- | |
64 | bt_nofile(buf) | |
65 | buf_T *buf; | |
66 | { | |
67 | ! return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') | |
68 | ! || buf->b_p_bt[0] == 'a'); | |
69 | } | |
70 | ||
71 | /* | |
72 | *************** | |
73 | *** 2697,2703 **** | |
74 | bt_dontwrite(buf) | |
75 | buf_T *buf; | |
76 | { | |
77 | ! return (buf->b_p_bt[0] == 'n'); | |
78 | } | |
79 | ||
80 | int | |
81 | --- 2697,2703 ---- | |
82 | bt_dontwrite(buf) | |
83 | buf_T *buf; | |
84 | { | |
85 | ! return buf != NULL && buf->b_p_bt[0] == 'n'; | |
86 | } | |
87 | ||
88 | int | |
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 | |
91 | *************** | |
92 | *** 2170,2176 **** | |
93 | ||
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) | |
97 | help_window = TRUE; | |
98 | else | |
99 | clear_snapshot(curtab, SNAP_HELP_IDX); | |
100 | --- 2170,2176 ---- | |
101 | ||
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) | |
105 | help_window = TRUE; | |
106 | else | |
107 | clear_snapshot(curtab, SNAP_HELP_IDX); | |
108 | *************** | |
109 | *** 2214,2226 **** | |
110 | ||
111 | #ifdef FEAT_SYN_HL | |
112 | /* Free independent synblock before the buffer is freed. */ | |
113 | ! reset_synblock(win); | |
114 | #endif | |
115 | ||
116 | /* | |
117 | * Close the link to the buffer. | |
118 | */ | |
119 | ! close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0); | |
120 | ||
121 | /* Autocommands may have closed the window already, or closed the only | |
122 | * other window or moved to another tab page. */ | |
123 | --- 2214,2228 ---- | |
124 | ||
125 | #ifdef FEAT_SYN_HL | |
126 | /* Free independent synblock before the buffer is freed. */ | |
127 | ! if (win->w_buffer != NULL) | |
128 | ! reset_synblock(win); | |
129 | #endif | |
130 | ||
131 | /* | |
132 | * Close the link to the buffer. | |
133 | */ | |
134 | ! if (win->w_buffer != NULL) | |
135 | ! close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0); | |
136 | ||
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 | |
141 | *************** | |
142 | *** 716,717 **** | |
143 | --- 716,719 ---- | |
144 | { /* Add new patch number below this line */ | |
145 | + /**/ | |
146 | + 390, | |
147 | /**/ | |
148 | ||
149 | -- | |
150 | There can't be a crisis today, my schedule is already full. | |
151 | ||
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 /// |