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.
652dee4486

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.
This commit is contained in:
Sean Dewar
2022-01-29 05:27:29 +00:00
parent 082ff2190c
commit 15c9d88bb7
4 changed files with 15 additions and 22 deletions

View File

@@ -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);