Skip to content

Commit

Permalink
Merge pull request #8080 from SparkiDev/coverity_fix_5
Browse files Browse the repository at this point in the history
Unit test: fix coverity issue
  • Loading branch information
douzzer authored Oct 16, 2024
2 parents 4ed3c00 + b8d3b99 commit 9665434
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -55178,8 +55178,8 @@ static int test_wolfSSL_i2d_ASN1_TYPE(void)
#if defined(OPENSSL_EXTRA)
/* Taken from one of sssd's certs othernames */
unsigned char str_bin[] = {
0x04, 0x10, 0xa4, 0x9b, 0xc8, 0xf4, 0x85, 0x8e, 0x89, 0x4d, 0x85, 0x8d,
0x27, 0xbd, 0x63, 0xaa, 0x93, 0x93
0x04, 0x10, 0xa4, 0x9b, 0xc8, 0xf4, 0x85, 0x8e, 0x89, 0x4d, 0x85, 0x8d,
0x27, 0xbd, 0x63, 0xaa, 0x93, 0x93
};
ASN1_TYPE* asn1type = NULL;
unsigned char* der = NULL;
Expand All @@ -55190,10 +55190,12 @@ static int test_wolfSSL_i2d_ASN1_TYPE(void)
ExpectNotNull(str = ASN1_STRING_type_new(V_ASN1_SEQUENCE));
ExpectIntEQ(ASN1_STRING_set(str, str_bin, sizeof(str_bin)), 1);
ExpectNotNull(asn1type = ASN1_TYPE_new());
if (EXPECT_FAIL()) {
if (asn1type != NULL) {
ASN1_TYPE_set(asn1type, V_ASN1_SEQUENCE, str);
}
else {
ASN1_STRING_free(str);
}
ASN1_TYPE_set(asn1type, V_ASN1_SEQUENCE, str);
}

ExpectIntEQ(i2d_ASN1_TYPE(asn1type, NULL), sizeof(str_bin));
Expand Down

0 comments on commit 9665434

Please sign in to comment.