Skip to content

Commit 69b28cd

Browse files
authored
Merge pull request #9801 from LinuxJedi/static-fixes3
Fix things found in static analysis
2 parents 3a1aa83 + 17680a2 commit 69b28cd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15671,7 +15671,7 @@ int wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX* ctx, void* arg)
1567115671
int wolfSSL_CRYPTO_memcmp(const void *a, const void *b, size_t size)
1567215672
{
1567315673
if (!a || !b)
15674-
return 0;
15674+
return -1;
1567515675
return ConstantCompare((const byte*)a, (const byte*)b, (int)size);
1567615676
}
1567715677

wolfcrypt/src/asn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9300,7 +9300,7 @@ int wc_GetKeyOID(byte* key, word32 keySz, const byte** curveOID, word32* oidSz,
93009300
if (falcon == NULL)
93019301
return MEMORY_E;
93029302

9303-
if (wc_falcon_init(falcon) != 0) {
9303+
if (wc_falcon_init(falcon) == 0) {
93049304
tmpIdx = 0;
93059305
if (wc_falcon_set_level(falcon, 1) == 0) {
93069306
if (wc_Falcon_PrivateKeyDecode(key, &tmpIdx, falcon, keySz)
@@ -9387,7 +9387,7 @@ int wc_GetKeyOID(byte* key, word32 keySz, const byte** curveOID, word32* oidSz,
93879387
if (sphincs == NULL)
93889388
return MEMORY_E;
93899389

9390-
if (wc_sphincs_init(sphincs) != 0) {
9390+
if (wc_sphincs_init(sphincs) == 0) {
93919391
tmpIdx = 0;
93929392
if (wc_sphincs_set_level_and_optim(sphincs, 1, FAST_VARIANT)
93939393
== 0) {

wolfcrypt/src/pkcs7.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10494,7 +10494,7 @@ static int wc_PKCS7_DecryptKtri(wc_PKCS7* pkcs7, byte* in, word32 inSz,
1049410494
DYNAMIC_TYPE_TMP_BUFFER);
1049510495
#ifndef WC_NO_RSA_OAEP
1049610496
if (encOID == RSAESOAEPk) {
10497-
if (!outKey) {
10497+
if (outKey) {
1049810498
XFREE(outKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
1049910499
}
1050010500
}
@@ -10510,7 +10510,7 @@ static int wc_PKCS7_DecryptKtri(wc_PKCS7* pkcs7, byte* in, word32 inSz,
1051010510
WC_FREE_VAR_EX(privKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
1051110511
#ifndef WC_NO_RSA_OAEP
1051210512
if (encOID == RSAESOAEPk) {
10513-
if (!outKey) {
10513+
if (outKey) {
1051410514
XFREE(outKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
1051510515
}
1051610516
}

0 commit comments

Comments
 (0)