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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user