Code review feedback. Error out on len = 0 as well.

This commit is contained in:
Kareem
2026-03-13 14:10:37 -07:00
parent 0a082b08ca
commit 3cc15548bc
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;