From aeb68bbb074ec20b51908f50f876d340d2dca020 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Thu, 8 Jan 2015 20:43:00 +0100 Subject: 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. --- src/nvim/normal.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index e1dc2b93d9..e1aed23e8c 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -11,6 +11,7 @@ * the operators. */ +#include #include #include #include @@ -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]; -- cgit