mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.1.0022: Coverity complains about improper use of negative value (#27001)
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: vim/vim#13824
49471963fe
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
786089013d
commit
89b0f5ac5a
@ -3170,7 +3170,7 @@ bool in_cinkeys(int keytyped, int when, bool line_is_empty)
|
||||
} else {
|
||||
// TODO(@brammool): multi-byte
|
||||
if (keytyped == (int)(uint8_t)p[-1]
|
||||
|| (icase && keytyped < 256
|
||||
|| (icase && keytyped < 256 && keytyped >= 0
|
||||
&& TOLOWER_LOC(keytyped) == TOLOWER_LOC((uint8_t)p[-1]))) {
|
||||
char *line = get_cursor_pos_ptr();
|
||||
assert(p >= look && (uintmax_t)(p - look) <= SIZE_MAX);
|
||||
|
Loading…
Reference in New Issue
Block a user