0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.0816: crash when using invalid buffer number

Problem:    Crash when using invalid buffer number.
Solution:   Check for NULL buffer. (Yasuhiro Matsumoto, closes #1899)
This commit is contained in:
Bram Moolenaar
2017-07-30 18:02:12 +02:00
parent 43c007ff22
commit f144a3fb73
3 changed files with 7 additions and 1 deletions

View File

@@ -1686,7 +1686,7 @@ term_get_buf(typval_T *argvars)
++emsg_off;
buf = get_buf_tv(&argvars[0], FALSE);
--emsg_off;
if (buf->b_term == NULL)
if (buf == NULL || buf->b_term == NULL)
return NULL;
return buf;
}