mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 19:50:49 +02:00
Code review feedback. Error out on len = 0 as well.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user