forked from wolfSSL/wolfssl
Merge pull request #5517 from JacobBarthelmeh/Testing
misc. testing items from static analysis tools
This commit is contained in:
@@ -526,6 +526,11 @@ static int wolfSSL_BIO_MEMORY_write(WOLFSSL_BIO* bio, const void* data,
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
||||
if (bio->mem_buf->data == NULL) {
|
||||
WOLFSSL_MSG("Buffer data is NULL");
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
||||
XMEMCPY(bio->mem_buf->data + bio->wrSz, data, len);
|
||||
bio->ptr = bio->mem_buf->data;
|
||||
bio->num = (int)bio->mem_buf->max;
|
||||
|
@@ -37059,6 +37059,7 @@ static int test_wolfSSL_ASN1_TIME_adj(void)
|
||||
/* negative offset */
|
||||
offset_sec = -45 * mini;
|
||||
asn_time = wolfSSL_ASN1_TIME_adj(s, t, offset_day, offset_sec);
|
||||
AssertNotNull(asn_time);
|
||||
AssertTrue(asn_time->type == asn_utc_time);
|
||||
XSTRNCPY(date_str, (const char*)&asn_time->data, CTC_DATE_SIZE);
|
||||
date_str[CTC_DATE_SIZE] = '\0';
|
||||
|
@@ -6060,7 +6060,7 @@ static int DecodeRsaPssParams(const byte* params, word32 sz,
|
||||
int ret = 0;
|
||||
word32 idx = 0;
|
||||
int len = 0;
|
||||
word32 oid;
|
||||
word32 oid = 0;
|
||||
byte tag;
|
||||
int length;
|
||||
|
||||
@@ -18885,8 +18885,8 @@ static int DecodeSubjInfoAcc(const byte* input, int sz, DecodedCert* cert)
|
||||
if (GetLength(input, &idx, &length, sz) < 0)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
/* Set ocsp entry */
|
||||
if (b == GENERALNAME_URI && oid == AIA_OCSP_OID) {
|
||||
/* Set caRepo entry */
|
||||
if (b == GENERALNAME_URI && oid == AIA_CA_REPO_OID) {
|
||||
cert->extSubjInfoAccCaRepoSz = length;
|
||||
cert->extSubjInfoAccCaRepo = input + idx;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user