summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-27 22:03:50 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-27 22:03:50 +0200
commitd28cc3f55d4a5a980f6ac6fa682382822a223720 (patch)
treeafbd1226f742817a8a86a8d256587bf2a93a7daf /src/buffer.c
parentab6eec3887d68c260b50b1b8f9ed95d49d9306c6 (diff)
patch 8.0.0782: using freed memory in quickfix codev8.0.0782
Problem: Using freed memory in quickfix code. (Dominique Pelle) Solution: Handle a help window differently. (Yegappan Lakshmanan)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4dbb9e91b5..45100788b0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -249,7 +249,7 @@ open_buffer(
netbeansFireChanges = oldFire;
#endif
/* Help buffer is filtered. */
- if (curbuf->b_help)
+ if (bt_help(curbuf))
fix_help_buffer();
}
else if (read_stdin)
@@ -5669,6 +5669,15 @@ bt_terminal(buf_T *buf)
}
/*
+ * Return TRUE if "buf" is a help buffer.
+ */
+ int
+bt_help(buf_T *buf)
+{
+ return buf != NULL && buf->b_help;
+}
+
+/*
* Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
* This means the buffer name is not a file name.
*/