Merge pull request #7345 from JacobBarthelmeh/coverity

Coverity fixes
This commit is contained in:
David Garske
2024-03-18 08:15:59 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -15019,7 +15019,7 @@ int wc_ValidateDate(const byte* date, byte format, int dateType)
ltime = wc_Time(0); ltime = wc_Time(0);
#ifndef NO_TIME_SIGNEDNESS_CHECK #ifndef NO_TIME_SIGNEDNESS_CHECK
if (sizeof(ltime) == sizeof(word32) && (int)ltime < 0){ if (sizeof(ltime) == sizeof(word32) && (sword32)ltime < 0){
/* A negative response here could be due to a 32-bit time_t /* A negative response here could be due to a 32-bit time_t
* where the year is 2038 or later. */ * where the year is 2038 or later. */
WOLFSSL_MSG("wc_Time failed to return a valid value"); WOLFSSL_MSG("wc_Time failed to return a valid value");

View File

@@ -1104,9 +1104,9 @@ void fp_mod_2d(fp_int *a, int b, fp_int *c)
bmax = ((unsigned int)b + DIGIT_BIT - 1) / DIGIT_BIT; bmax = ((unsigned int)b + DIGIT_BIT - 1) / DIGIT_BIT;
/* If a is negative and bmax is larger than FP_SIZE, then the /* If a is negative and bmax is greater than or equal to FP_SIZE, then the
* result can't fit within c. Just return. */ * result can't fit within c. Just return. */
if (c->sign == FP_NEG && bmax > FP_SIZE) { if (c->sign == FP_NEG && bmax >= FP_SIZE) {
return; return;
} }