aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDundar Goc <gocdundar@gmail.com>2022-05-20 15:13:52 +0200
committerDundar Goc <gocdundar@gmail.com>2022-05-20 15:15:13 +0200
commit02fd4ec83f171b7dce626501630a23c8d2ada01a (patch)
tree016ad66d79df565bd5052aa06304610dfc8680ad /src
parent1d160a76ec46e7eb4cfa627fb85987059fae55c4 (diff)
downloadrneovim-02fd4ec83f171b7dce626501630a23c8d2ada01a.tar.gz
rneovim-02fd4ec83f171b7dce626501630a23c8d2ada01a.tar.bz2
rneovim-02fd4ec83f171b7dce626501630a23c8d2ada01a.zip
vim-patch:8.2.4985: PVS warns for possible array underrun
Problem: PVS warns for possible array underrun. Solution: Add a check for a positive value. (closes vim/vim#10451) https://github.com/vim/vim/commit/875339b22a989d0782097036169e8fb9e2100d7e
Diffstat (limited to 'src')
-rw-r--r--src/nvim/spell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 1ba29e3fc1..df3ee73a28 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -443,7 +443,7 @@ size_t spell_check(win_T *wp, char_u *ptr, hlf_T *attrp, int *capcol, bool docou
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] = ' ';
}