]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.0324: off-by-one error in cmdidx check v8.1.0324
authorBram Moolenaar <Bram@vim.org>
Thu, 23 Aug 2018 20:51:40 +0000 (22:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 23 Aug 2018 20:51:40 +0000 (22:51 +0200)
Problem:    Off-by-one error in cmdidx check. (Coverity)
Solution:   Use ">=" instead of ">".

src/ex_docmd.c
src/version.c

index fc2b20ea7d1c11b4be376dae3f372c6880187d2b..d4cf6a2c04aad8d2acbfb1ffc5d0867dfdcaa05b 100644 (file)
@@ -12554,7 +12554,7 @@ ex_folddo(exarg_T *eap)
     int
 is_loclist_cmd(int cmdidx)
 {
-    if (cmdidx < 0 || cmdidx > CMD_SIZE)
+    if (cmdidx < 0 || cmdidx >= CMD_SIZE)
        return FALSE;
     return cmdnames[cmdidx].cmd_name[0] == 'l';
 }
index 01854c85cb811248802a7c573232d0cc972ca7e2..bf40df79e98e6ff9ee4f3d4431c5bddadac6ec05 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    324,
 /**/
     323,
 /**/