# HG changeset patch # User Bram Moolenaar # Date 1653052504 -7200 # Node ID 46fa2d54e3894e8fbf2005e993fd1baace1448f2 # Parent e77054ee4f23dc04e9efbff60ed1cdca7c930c29 patch 8.2.4985: PVS warns for possible array underrun Commit: https://github.com/vim/vim/commit/875339b22a989d0782097036169e8fb9e2100d7e Author: Bram Moolenaar Date: Fri May 20 14:10:50 2022 +0100 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 https://github.com/vim/vim/issues/10451) diff --git a/src/spell.c b/src/spell.c --- 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 --- 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,