Skip to content

Commit 643cbe1

Browse files
authored
Merge pull request #9354 from rlm2002/coverity
20251027 Coverity fixes
2 parents 7085421 + e546d31 commit 643cbe1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/x509.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12375,7 +12375,14 @@ WOLFSSL_X509_CRL* wolfSSL_PEM_read_X509_CRL(XFILE fp,
1237512375
return WOLFSSL_FAILURE;
1237612376
}
1237712377

12378-
if ((l = wolfSSL_BIO_get_len(bio)) <= pem_struct_min_sz) {
12378+
l = wolfSSL_BIO_get_len(bio);
12379+
12380+
if (l < 0) {
12381+
WOLFSSL_ERROR(BAD_FUNC_ARG);
12382+
return WOLFSSL_FAILURE;
12383+
}
12384+
12385+
if (l <= pem_struct_min_sz) {
1237912386
/* No certificate in buffer */
1238012387
WOLFSSL_ERROR(ASN_NO_PEM_HEADER);
1238112388
return WOLFSSL_FAILURE;

wolfcrypt/src/sp_int.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18272,7 +18272,7 @@ int sp_to_unsigned_bin_len_ct(const sp_int* a, byte* out, int outSz)
1827218272
out[j--] = (byte)(d & mask);
1827318273
d >>= 8;
1827418274
}
18275-
mask &= (sp_int_digit)0 - notFull;
18275+
mask &= (sp_int_digit)(-(int)notFull);
1827618276
i += (unsigned int)(1 & mask);
1827718277
}
1827818278
}

0 commit comments

Comments
 (0)