Fix valgrind issue

This commit is contained in:
Eric Blankenhorn
2020-02-20 17:28:17 -06:00
parent b74dac6171
commit 403c263e0b

View File

@ -18082,8 +18082,10 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
ctx->block_size = 1;
ctx->ivSz = AES_BLOCK_SIZE;
if (iv)
XMEMCPY(ctx->iv, iv, ctx->ivSz);
if (iv != NULL) {
if (iv != ctx->iv) /* Valgrind error when src == dst */
XMEMCPY(ctx->iv, iv, ctx->ivSz);
}
else
XMEMSET(ctx->iv, 0, AES_BLOCK_SIZE);
@ -18110,8 +18112,10 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
ctx->block_size = 1;
ctx->ivSz = AES_BLOCK_SIZE;
if (iv)
XMEMCPY(ctx->iv, iv, ctx->ivSz);
if (iv != NULL) {
if (iv != ctx->iv) /* Valgrind error when src == dst */
XMEMCPY(ctx->iv, iv, ctx->ivSz);
}
else
XMEMSET(ctx->iv, 0, AES_BLOCK_SIZE);