diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-20 14:10:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-20 14:10:50 +0100 |
commit | 875339b22a989d0782097036169e8fb9e2100d7e (patch) | |
tree | 02f7ab1621efe93bffcce6f5e2654f6d77b151c8 | |
parent | 6dab00aa5417f62f8c2c85c7c4ae871b4f1171f4 (diff) | |
download | vim-git-875339b22a989d0782097036169e8fb9e2100d7e.tar.gz |
patch 8.2.4985: PVS warns for possible array underrunv8.2.4985
Problem: PVS warns for possible array underrun.
Solution: Add a check for a positive value. (closes #10451)
-rw-r--r-- | src/spell.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/spell.c b/src/spell.c index e5c2f7d1f..48a2203e3 100644 --- a/src/spell.c +++ b/src/spell.c @@ -253,7 +253,7 @@ spell_check( MAXWLEN + 1); mi.mi_fwordlen = (int)STRLEN(mi.mi_fword); - if (camel_case) + if (camel_case && mi.mi_fwordlen > 0) // Introduce a fake word end space into the folded word. mi.mi_fword[mi.mi_fwordlen - 1] = ' '; diff --git a/src/version.c b/src/version.c index 40b81d1f3..09bf61d87 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4985, +/**/ 4984, /**/ 4983, |