From 828a18722c2fb2d23560fd38ae182359e943d589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eliseo=20Marti=CC=81nez?= Date: Mon, 26 Jan 2015 21:28:41 +0100 Subject: [PATCH] coverity/13750: Negative array index read: FP. Problem : Negative array index read @ 909. Diagnostic : False positive. Rationale : Suggested error path assigns a negative value to idx at line 836 (`idx = find_command(ca.cmdchar);`). That's impossible, as `ca.cmdchar` is set to Ctrl_BSL just two lines above, so we know that value will be in the table. Resolution : Assert idx >= 0. --- src/nvim/normal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/normal.c b/src/nvim/normal.c index f140922082..e147280723 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -834,6 +834,7 @@ getcount: ca.cmdchar = Ctrl_BSL; ca.nchar = c; idx = find_command(ca.cmdchar); + assert(idx >= 0); } } }