mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 07:10:49 +02:00
Code review feedback
This commit is contained in:
@@ -1956,7 +1956,7 @@ int _wc_Hash_Grow(byte** msg, word32* used, word32* len, const byte* in,
|
||||
{
|
||||
word32 usedSz = 0;
|
||||
|
||||
if (!WC_SAFE_SUM_WORD32(*used, (word32)inSz, usedSz))
|
||||
if (inSz <= 0 || !WC_SAFE_SUM_WORD32(*used, (word32)inSz, usedSz))
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
if (*len < usedSz) {
|
||||
|
||||
@@ -278,6 +278,9 @@ int se050_hash_update(SE050_HASH_Context* se050Ctx, const byte* data, word32 len
|
||||
if (se050Ctx->msg == NULL) {
|
||||
se050Ctx->msg = (byte*)XMALLOC(usedSz,
|
||||
se050Ctx->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (se050Ctx->msg == NULL) {
|
||||
return MEMORY_E;
|
||||
}
|
||||
XMEMSET(se050Ctx->msg, 0, usedSz);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user