Merge pull request #9801 from LinuxJedi/static-fixes3

Fix things found in static analysis
This commit is contained in:
David Garske
2026-02-19 08:44:38 -08:00
committed by GitHub
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -15671,7 +15671,7 @@ int wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX* ctx, void* arg)
int wolfSSL_CRYPTO_memcmp(const void *a, const void *b, size_t size)
{
if (!a || !b)
return 0;
return -1;
return ConstantCompare((const byte*)a, (const byte*)b, (int)size);
}
+2 -2
View File
@@ -9300,7 +9300,7 @@ int wc_GetKeyOID(byte* key, word32 keySz, const byte** curveOID, word32* oidSz,
if (falcon == NULL)
return MEMORY_E;
if (wc_falcon_init(falcon) != 0) {
if (wc_falcon_init(falcon) == 0) {
tmpIdx = 0;
if (wc_falcon_set_level(falcon, 1) == 0) {
if (wc_Falcon_PrivateKeyDecode(key, &tmpIdx, falcon, keySz)
@@ -9387,7 +9387,7 @@ int wc_GetKeyOID(byte* key, word32 keySz, const byte** curveOID, word32* oidSz,
if (sphincs == NULL)
return MEMORY_E;
if (wc_sphincs_init(sphincs) != 0) {
if (wc_sphincs_init(sphincs) == 0) {
tmpIdx = 0;
if (wc_sphincs_set_level_and_optim(sphincs, 1, FAST_VARIANT)
== 0) {
+2 -2
View File
@@ -10494,7 +10494,7 @@ static int wc_PKCS7_DecryptKtri(wc_PKCS7* pkcs7, byte* in, word32 inSz,
DYNAMIC_TYPE_TMP_BUFFER);
#ifndef WC_NO_RSA_OAEP
if (encOID == RSAESOAEPk) {
if (!outKey) {
if (outKey) {
XFREE(outKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
}
}
@@ -10510,7 +10510,7 @@ static int wc_PKCS7_DecryptKtri(wc_PKCS7* pkcs7, byte* in, word32 inSz,
WC_FREE_VAR_EX(privKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
#ifndef WC_NO_RSA_OAEP
if (encOID == RSAESOAEPk) {
if (!outKey) {
if (outKey) {
XFREE(outKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
}
}