From: Wenkai Lin linwenkai6@hisilicon.com
When uadk_e_digest_copy execute, priv ctx maybe null pointer, it should return directly.
Signed-off-by: Wenkai Lin linwenkai6@hisilicon.com --- src/uadk_digest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/uadk_digest.c b/src/uadk_digest.c index b7b9533..52f4ef7 100644 --- a/src/uadk_digest.c +++ b/src/uadk_digest.c @@ -954,6 +954,8 @@ static int uadk_e_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) (struct digest_priv_ctx *)EVP_MD_CTX_md_data(to); struct ctx_info *node = NULL;
+ if (!f || !t) + return 1; /* * EVP_MD_CTX_copy will copy from->priv to to->priv, * including data pointer. Instead of coping data contents, @@ -980,7 +982,7 @@ static int uadk_e_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) node->data = t->data; pthread_mutex_unlock(&digest_ctx_mutex);
- if (f && f->data) + if (f->data) t->copy = true;
return 1;