Fixes for minor scan-build warnings

This commit is contained in:
Lealem Amedie
2025-11-05 21:27:06 -07:00
parent 9fdcd2e72a
commit 08db159c5d
5 changed files with 11 additions and 6 deletions

View File

@@ -2950,7 +2950,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
#endif /* HAVE_RPK */
break;
case 268:
#ifndef NO_CERTS
fileFormat = WOLFSSL_FILETYPE_ASN1;
#endif
break;
case 269:
#if defined(WOLFSSL_SYS_CRYPTO_POLICY)

View File

@@ -10558,6 +10558,7 @@ static int DoTls13CertificateVerify(WOLFSSL* ssl, byte* input,
case TLS_ASYNC_DO:
{
sig = input + args->idx;
(void)sig;
#ifdef WOLFSSL_DUAL_ALG_CERTS
if (ssl->sigSpec != NULL &&
*ssl->sigSpec == WOLFSSL_CKS_SIGSPEC_BOTH) {

View File

@@ -20118,7 +20118,7 @@ static int test_wolfSSL_PKCS7_certs(void)
while (EXPECT_SUCCESS() && (sk_X509_INFO_num(info_sk) > 0)) {
X509_INFO* info = NULL;
ExpectNotNull(info = sk_X509_INFO_shift(info_sk));
if (info != NULL) {
if (EXPECT_SUCCESS() && info != NULL) {
ExpectIntGT(sk_X509_push(sk, info->x509), 0);
info->x509 = NULL;
}

View File

@@ -4207,8 +4207,9 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
#ifdef FORCE_FAILURE_GETRANDOM
/* don't fallback to /dev/urandom */
return ret;
#else
/* reset error and fallback to using /dev/urandom */
#elif !defined(NO_FILESYSTEM)
/* reset error and fallback to using /dev/urandom if filesystem
* support is compiled in */
ret = 0;
#endif
}

View File

@@ -8561,10 +8561,11 @@ int sp_rshb(const sp_int* a, int n, sp_int* r)
}
else {
/* Move the bits down starting at least significant digit. */
for (j = 0; i < a->used - 1; i++, j++)
r->dp[j] = (a->dp[i] >> n) | (a->dp[i+1] << (SP_WORD_SIZE - n));
for (j = 0; j < (sp_size_t)(a->used - 1 - i); j++)
r->dp[j] = (a->dp[j+i] >> n) |
(a->dp[j+i+1] << (SP_WORD_SIZE - n));
/* Most significant digit has no higher digit to pull from. */
r->dp[j] = a->dp[i] >> n;
r->dp[j] = a->dp[j+i] >> n;
/* Set the count of used digits. */
r->used = (sp_size_t)(j + (r->dp[j] > 0));
}