diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-29 05:27:29 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-29 06:31:51 +0000 |
commit | 15c9d88bb70b8ee9bdcf3c6fe7debc01a1ee5f36 (patch) | |
tree | beecb46ac02761fd635349054d2c5afb9edc7d0e /src/nvim/buffer.c | |
parent | 082ff2190c793d21c213748e556191f8aaa76cde (diff) | |
download | rneovim-15c9d88bb70b8ee9bdcf3c6fe7debc01a1ee5f36.tar.gz rneovim-15c9d88bb70b8ee9bdcf3c6fe7debc01a1ee5f36.tar.bz2 rneovim-15c9d88bb70b8ee9bdcf3c6fe7debc01a1ee5f36.zip |
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.
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 6 |
1 files changed, 2 insertions, 4 deletions
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); |