mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
coverity/13763: Out-of-bounds read: FP.
Problem : Out-of-bound read from a buffer. Diagnostic : False positive. Rationale : nv_max_linear should always be less than nv_cmd_idx size (NV_CMDS_SIZE). Resolution : Assert rationale.
This commit is contained in:
parent
d96e1c1ec3
commit
aeb68bbb07
@ -11,6 +11,7 @@
|
||||
* the operators.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
@ -388,6 +389,7 @@ static int find_command(int cmdchar)
|
||||
|
||||
/* If the character is in the first part: The character is the index into
|
||||
* nv_cmd_idx[]. */
|
||||
assert(nv_max_linear < (int)NV_CMDS_SIZE);
|
||||
if (cmdchar <= nv_max_linear)
|
||||
return nv_cmd_idx[cmdchar];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user