Merge pull request #6341 from douzzer/20230425-analyzer-coddling

20230425-analyzer-coddling
This commit is contained in:
JacobBarthelmeh 2023-04-26 11:22:23 -06:00 committed by GitHub
commit 32c6a66a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -20112,6 +20112,12 @@ static int DecodeCertInternal(DecodedCert* cert, int verify, int* criticalExt,
/* Parse the X509 certificate. */
ret = GetASN_Items(x509CertASN, dataASN, x509CertASN_Length, 1,
cert->source, &cert->srcIdx, cert->maxIdx);
#ifdef WOLFSSL_CLANG_TIDY
/* work around clang-tidy false positive re cert->source. */
if ((ret == 0) && (cert->source == NULL)) {
ret = ASN_PARSE_E;
}
#endif
}
/* Check version is valid/supported - can't be negative. */
if ((ret == 0) && (version > MAX_X509_VERSION)) {
@ -20304,7 +20310,7 @@ static int DecodeCertInternal(DecodedCert* cert, int verify, int* criticalExt,
KEYID_SIZE) == 0);
}
if (stopAtPubKey) {
ret = pubKeyOffset;
ret = (int)pubKeyOffset;
}
}

View File

@ -764,7 +764,7 @@ typedef struct sp_ecc_ctx {
* Must have at least one digit.
*/
#define MP_INT_SIZEOF(cnt) \
(sizeof(sp_int) - (SP_INT_DIGITS - (((cnt) == 0) ? 1 : (cnt))) * \
(sizeof(sp_int_minimal) + (((cnt) <= 1) ? 0 : ((cnt) - 1)) * \
sizeof(sp_int_digit))
/* The address of the next sp_int after one with 'cnt' digits. */
#define MP_INT_NEXT(t, cnt) \