Code review feedback

This commit is contained in:
Kareem
2026-03-12 15:12:48 -07:00
parent 42b321a7d3
commit 0a082b08ca
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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) {
+3
View File
@@ -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 {