Skip to content

Commit b85d362

Browse files
committed
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.
1 parent ba9c23e commit b85d362

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/spellfile.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,13 +1258,15 @@ read_compound(FILE *fd, slang_T *slang, int len)
12581258

12591259
gap = &slang->sl_comppat;
12601260
c = get2c(fd); // <comppatcount>
1261+
if (c < 0)
1262+
return SP_TRUNCERROR;
12611263
todo -= 2;
12621264
ga_init2(gap, sizeof(char_u *), c);
12631265
if (ga_grow(gap, c) == OK)
12641266
while (--c >= 0)
12651267
{
12661268
((char_u **)(gap->ga_data))[gap->ga_len++] =
1267-
read_cnt_string(fd, 1, &cnt);
1269+
read_cnt_string(fd, 1, &cnt);
12681270
// <comppatlen> <comppattext>
12691271
if (cnt < 0)
12701272
return cnt;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3328,
758760
/**/
759761
3327,
760762
/**/

0 commit comments

Comments
 (0)