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); // + if (c < 0) { + return SP_TRUNCERROR; + } todo -= 2; ga_init(gap, sizeof(char_u *), c); ga_grow(gap, c);