Skip to content

Commit 3cc1554

Browse files
Code review feedback. Error out on len = 0 as well.
1 parent 0a082b0 commit 3cc1554

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/port/nxp/se050_port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int se050_hash_update(SE050_HASH_Context* se050Ctx, const byte* data, word32 len
269269
byte* tmp = NULL;
270270
word32 usedSz = 0;
271271

272-
if (se050Ctx == NULL || (len > 0 && data == NULL) ||
272+
if (se050Ctx == NULL || (len > 0 && data == NULL) || (len == 0) ||
273273
!WC_SAFE_SUM_WORD32(se050Ctx->used, len, usedSz)) {
274274
return BAD_FUNC_ARG;
275275
}

wolfcrypt/src/port/ti/ti-hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int hashUpdate(wolfssl_TI_Hash *hash, const byte* data, word32 len)
7777
void *p;
7878
word32 usedSz = 0;
7979

80-
if ((hash== NULL) || (data == NULL) ||
80+
if ((hash == NULL) || (data == NULL) || (len == 0) ||
8181
!WC_SAFE_SUM_WORD32(hash->used, len, usedSz))
8282
return BAD_FUNC_ARG;
8383

0 commit comments

Comments
 (0)