aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spellfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/spellfile.c')
-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);