0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.1.0022: Coverity complains about improper use of negative value

Problem:  Coverity complains about improper use of negative value
Solution: Add a condition to validate that keytyped is larger or equal
          to 0

Apparently patch 9.1.0006 made it more explicit for Coverity, that the
TOLOWER_LOC() macros do not handle negative values properly. However,
that condition has always been there even before that, so add a
condition to verify that keytyped is indeed at least 0

closes: #13824

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-01-12 17:48:08 +01:00
parent 424ec1f235
commit 49471963fe
2 changed files with 4 additions and 1 deletions

View File

@@ -4108,7 +4108,8 @@ in_cinkeys(
} }
else else
// TODO: multi-byte // TODO: multi-byte
if (keytyped == (int)p[-1] || (icase && keytyped < 256 if (keytyped == (int)p[-1] || (icase
&& keytyped < 256 && keytyped >= 0
&& TOLOWER_LOC(keytyped) == TOLOWER_LOC((int)p[-1]))) && TOLOWER_LOC(keytyped) == TOLOWER_LOC((int)p[-1])))
{ {
line = ml_get_cursor(); line = ml_get_cursor();

View File

@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
22,
/**/ /**/
21, 21,
/**/ /**/