Skip to content

Commit 69bc5c1

Browse files
authored
Merge pull request #7345 from JacobBarthelmeh/coverity
Coverity fixes
2 parents 36e67af + 763c4a0 commit 69bc5c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

wolfcrypt/src/asn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15019,7 +15019,7 @@ int wc_ValidateDate(const byte* date, byte format, int dateType)
1501915019

1502015020
ltime = wc_Time(0);
1502115021
#ifndef NO_TIME_SIGNEDNESS_CHECK
15022-
if (sizeof(ltime) == sizeof(word32) && (int)ltime < 0){
15022+
if (sizeof(ltime) == sizeof(word32) && (sword32)ltime < 0){
1502315023
/* A negative response here could be due to a 32-bit time_t
1502415024
* where the year is 2038 or later. */
1502515025
WOLFSSL_MSG("wc_Time failed to return a valid value");

wolfcrypt/src/tfm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,9 @@ void fp_mod_2d(fp_int *a, int b, fp_int *c)
11041104

11051105
bmax = ((unsigned int)b + DIGIT_BIT - 1) / DIGIT_BIT;
11061106

1107-
/* If a is negative and bmax is larger than FP_SIZE, then the
1107+
/* If a is negative and bmax is greater than or equal to FP_SIZE, then the
11081108
* result can't fit within c. Just return. */
1109-
if (c->sign == FP_NEG && bmax > FP_SIZE) {
1109+
if (c->sign == FP_NEG && bmax >= FP_SIZE) {
11101110
return;
11111111
}
11121112

0 commit comments

Comments
 (0)