Skip to content

Commit 45306e9

Browse files
Merge pull request #8845 from rlm2002/coverityTests
Coverity: test adjustments and variable checks
2 parents f4821eb + a413be1 commit 45306e9

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tests/api.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19697,10 +19697,12 @@ static int test_wolfSSL_i2c_ASN1_INTEGER(void)
1969719697
ExpectNotNull(pp = (unsigned char*)XMALLOC(ret + 1, NULL,
1969819698
DYNAMIC_TYPE_TMP_BUFFER));
1969919699
tpp = pp;
19700-
ExpectNotNull(XMEMSET(tpp, 0, ret + 1));
19701-
ExpectIntEQ(i2c_ASN1_INTEGER(a, &tpp), 1);
19702-
tpp--;
19703-
ExpectIntEQ(*tpp, 40);
19700+
if (tpp != NULL) {
19701+
ExpectNotNull(XMEMSET(tpp, 0, ret + 1));
19702+
ExpectIntEQ(i2c_ASN1_INTEGER(a, &tpp), 1);
19703+
tpp--;
19704+
ExpectIntEQ(*tpp, 40);
19705+
}
1970419706
XFREE(pp, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1970519707
pp = NULL;
1970619708

@@ -40473,7 +40475,6 @@ static int test_wolfSSL_OPENSSL_hexstr2buf(void)
4047340475
ExpectIntEQ(expectedOutputs[i].buffer[j], returnedBuf[j]);
4047440476
}
4047540477
OPENSSL_free(returnedBuf);
40476-
returnedBuf = NULL;
4047740478
}
4047840479
#endif
4047940480
return EXPECT_RESULT();

0 commit comments

Comments
 (0)