From 15c9d88bb70b8ee9bdcf3c6fe7debc01a1ee5f36 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sat, 29 Jan 2022 05:27:29 +0000 Subject: vim-patch:8.2.4245: ":retab 0" may cause illegal memory access Problem: ":retab 0" may cause illegal memory access. Solution: Limit the value of 'tabstop' to 10000. https://github.com/vim/vim/commit/652dee448618589de5528a9e9a36995803f5557a ex_retab change is N/A (+vartabs always available). Nvim's set_num_option validation logic was refactored, hence why it looks different from Vim's. Also use XFREE_CLEAR in other places. --- src/nvim/buffer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index eee5a0b46c..52a7db3be2 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1899,10 +1899,8 @@ void free_buf_options(buf_T *buf, int free_p_ff) clear_string_option(&buf->b_p_flp); clear_string_option(&buf->b_p_isk); clear_string_option(&buf->b_p_vsts); - xfree(buf->b_p_vsts_nopaste); - buf->b_p_vsts_nopaste = NULL; - xfree(buf->b_p_vsts_array); - buf->b_p_vsts_array = NULL; + XFREE_CLEAR(buf->b_p_vsts_nopaste); + XFREE_CLEAR(buf->b_p_vsts_array); clear_string_option(&buf->b_p_vts); XFREE_CLEAR(buf->b_p_vts_array); clear_string_option(&buf->b_p_keymap); -- cgit