]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.382 v7.2.382
authorBram Moolenaar <Bram@vim.org>
Tue, 2 Mar 2010 16:23:21 +0000 (17:23 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 2 Mar 2010 16:23:21 +0000 (17:23 +0100)
Problem:    Accessing freed memory when closing the cmdline window when
            'bufhide' is set to "wipe".
Solution:   Check if the buffer still exists before invoking close_buffer()
            (Dominique Pelle)

src/ex_getln.c
src/version.c

index 6b5a824bdcb667f9dff758a9c5237d2080fdedc6..0f0f17075d1921c36777daaa6941a2e6598bc068 100644 (file)
@@ -6252,7 +6252,11 @@ ex_window()
        bp = curbuf;
        win_goto(old_curwin);
        win_close(wp, TRUE);
-       close_buffer(NULL, bp, DOBUF_WIPE);
+
+       /* win_close() may have already wiped the buffer when 'bh' is
+        * set to 'wipe' */
+       if (buf_valid(bp))
+           close_buffer(NULL, bp, DOBUF_WIPE);
 
        /* Restore window sizes. */
        win_size_restore(&winsizes);
index d541e2d04e08a5776e3a89a1bb11383460a58379..851d98b3c1d0543a286b67dbdc6238ef2e696da6 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    382,
 /**/
     381,
 /**/