diff --git a/wolfcrypt/src/port/nxp/se050_port.c b/wolfcrypt/src/port/nxp/se050_port.c index 0783323c22..e244ea35a9 100644 --- a/wolfcrypt/src/port/nxp/se050_port.c +++ b/wolfcrypt/src/port/nxp/se050_port.c @@ -269,7 +269,7 @@ int se050_hash_update(SE050_HASH_Context* se050Ctx, const byte* data, word32 len byte* tmp = NULL; word32 usedSz = 0; - if (se050Ctx == NULL || (len > 0 && data == NULL) || + if (se050Ctx == NULL || (len > 0 && data == NULL) || (len == 0) || !WC_SAFE_SUM_WORD32(se050Ctx->used, len, usedSz)) { return BAD_FUNC_ARG; } diff --git a/wolfcrypt/src/port/ti/ti-hash.c b/wolfcrypt/src/port/ti/ti-hash.c index d3024fc6d0..7a025b4bcc 100644 --- a/wolfcrypt/src/port/ti/ti-hash.c +++ b/wolfcrypt/src/port/ti/ti-hash.c @@ -77,7 +77,7 @@ static int hashUpdate(wolfssl_TI_Hash *hash, const byte* data, word32 len) void *p; word32 usedSz = 0; - if ((hash== NULL) || (data == NULL) || + if ((hash == NULL) || (data == NULL) || (len == 0) || !WC_SAFE_SUM_WORD32(hash->used, len, usedSz)) return BAD_FUNC_ARG;