aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-01-26 21:28:41 +0100
committerJustin M. Keyes <justinkz@gmail.com>2015-02-02 01:21:57 -0500
commit828a18722c2fb2d23560fd38ae182359e943d589 (patch)
treeab05fe947e59521487f3d0213fd2de5709a19b5b
parent4d70aae770e33c45a194634d11b9c49e866dd84b (diff)
downloadrneovim-828a18722c2fb2d23560fd38ae182359e943d589.tar.gz
rneovim-828a18722c2fb2d23560fd38ae182359e943d589.tar.bz2
rneovim-828a18722c2fb2d23560fd38ae182359e943d589.zip
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.
-rw-r--r--src/nvim/normal.c1
1 files changed, 1 insertions, 0 deletions
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);
}
}
}