aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-08-13 17:25:54 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-17 02:10:43 +0100
commit17f377b6f9e0859191c3aee3abaf2bbe2c03dfe6 (patch)
treea8500771d73ba2b64f6c95c7c50e270379f00aa6
parent2cbbab28d2854cc226ee90be0e9d2527cf53644d (diff)
downloadrneovim-17f377b6f9e0859191c3aee3abaf2bbe2c03dfe6.tar.gz
rneovim-17f377b6f9e0859191c3aee3abaf2bbe2c03dfe6.tar.bz2
rneovim-17f377b6f9e0859191c3aee3abaf2bbe2c03dfe6.zip
vim-patch:8.2.3328: Coverity error for not checking return value
Problem: Coverity error for not checking return value. Solution: Check value is not negative. https://github.com/vim/vim/commit/b85d3627d9a7b41d603c58a16d0ddbf6b88beeaf
-rw-r--r--src/nvim/spellfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 8b95178c84..843ecec1b1 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -1371,6 +1371,9 @@ static int read_compound(FILE *fd, slang_T *slang, int len)
gap = &slang->sl_comppat;
c = get2c(fd); // <comppatcount>
+ if (c < 0) {
+ return SP_TRUNCERROR;
+ }
todo -= 2;
ga_init(gap, sizeof(char_u *), c);
ga_grow(gap, c);