From 17f377b6f9e0859191c3aee3abaf2bbe2c03dfe6 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 13 Aug 2021 17:25:54 +0100 Subject: 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 --- src/nvim/spellfile.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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); -- cgit