mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4453: :helpgrep may free an option that was not allocated
Problem: :helpgrep may free an option that was not allocated. (Yegappan Lakshmanan) Solution: Check if the value was allocated.
This commit is contained in:
@@ -4479,6 +4479,14 @@ get_encoding_default(void)
|
||||
return (char_u *)NULL;
|
||||
}
|
||||
|
||||
int
|
||||
is_option_allocated(char *name)
|
||||
{
|
||||
int idx = findoption((char_u *)name);
|
||||
|
||||
return idx >= 0 && (options[idx].flags & P_ALLOCED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number.
|
||||
* When "has_lt" is true there is a '<' before "*arg_arg".
|
||||
|
Reference in New Issue
Block a user