mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/133845: Negative array index read. (FP)
`find_command(s->ca.cmdchar) >= 0` was established near the start of normal_execute(). And `unshift_special(&s->ca);` "should" not ever result in s->ca.cmdchar containing a multibyte char. So only an assert() is needed here.
This commit is contained in:
parent
73da522d73
commit
6be8ea0787
@ -1130,6 +1130,7 @@ static int normal_execute(VimState *state, int key)
|
||||
start_selection();
|
||||
unshift_special(&s->ca);
|
||||
s->idx = find_command(s->ca.cmdchar);
|
||||
assert(s->idx >= 0);
|
||||
} else if ((nv_cmds[s->idx].cmd_flags & NV_SSS)
|
||||
&& (mod_mask & MOD_MASK_SHIFT)) {
|
||||
start_selection();
|
||||
|
@ -613,7 +613,7 @@ function Screen:_pprint_attrs(attrs)
|
||||
return table.concat(items, ", ")
|
||||
end
|
||||
|
||||
function backward_find_meaningful(tbl, from) -- luacheck: ignore
|
||||
local function backward_find_meaningful(tbl, from) -- luacheck: no unused
|
||||
for i = from or #tbl, 1, -1 do
|
||||
if tbl[i] ~= ' ' then
|
||||
return i + 1
|
||||
|
Loading…
Reference in New Issue
Block a user