mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/13749: fix negative array index read in unset_global_local_option
This commit is contained in:
parent
a40a7cf24f
commit
aca6dc5001
@ -6516,10 +6516,13 @@ void comp_col(void)
|
|||||||
void unset_global_local_option(char *name, void *from)
|
void unset_global_local_option(char *name, void *from)
|
||||||
{
|
{
|
||||||
struct vimoption *p;
|
struct vimoption *p;
|
||||||
int opt_idx;
|
|
||||||
buf_T *buf = (buf_T *)from;
|
buf_T *buf = (buf_T *)from;
|
||||||
|
|
||||||
opt_idx = findoption((uint8_t *)name);
|
int opt_idx = findoption((uint8_t *)name);
|
||||||
|
if (opt_idx < 0) {
|
||||||
|
EMSG2(_("E355: Unknown option: %s"), name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
p = &(options[opt_idx]);
|
p = &(options[opt_idx]);
|
||||||
|
|
||||||
switch ((int)p->indir)
|
switch ((int)p->indir)
|
||||||
|
Loading…
Reference in New Issue
Block a user