diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-11 15:54:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-11 15:54:59 +0200 |
commit | b85d3627d9a7b41d603c58a16d0ddbf6b88beeaf (patch) | |
tree | 774427b5489aeaab6f35245e0ba368cbf588019a | |
parent | ba9c23e77655766f6c59de8be732b7577f795ed3 (diff) |
patch 8.2.3328: Coverity error for not checking return valuev8.2.3328
Problem: Coverity error for not checking return value.
Solution: Check value is not negative.
-rw-r--r-- | src/spellfile.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/spellfile.c b/src/spellfile.c index 058558eb32..0d7b194aa5 100644 --- a/src/spellfile.c +++ b/src/spellfile.c @@ -1258,13 +1258,15 @@ 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_init2(gap, sizeof(char_u *), c); if (ga_grow(gap, c) == OK) while (--c >= 0) { ((char_u **)(gap->ga_data))[gap->ga_len++] = - read_cnt_string(fd, 1, &cnt); + read_cnt_string(fd, 1, &cnt); // <comppatlen> <comppattext> if (cnt < 0) return cnt; diff --git a/src/version.c b/src/version.c index 12a78a8113..4041be41a3 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3328, +/**/ 3327, /**/ 3326, |