1 openssl: avoid NULL pointer dereference in EVP_DigestInit_ex()
3 We should avoid accessing the type pointer if it's NULL,
4 this could happen if ctx->digest is not NULL.
6 Upstream-Status: Submitted
7 http://www.mail-archive.com/openssl-dev@openssl.org/msg32860.html
9 Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
11 --- a/crypto/evp/digest.c
12 +++ b/crypto/evp/digest.c
17 - if (ctx->digest != type)
18 + if (type && (ctx->digest != type))
20 if (ctx->digest && ctx->digest->ctx_size)
21 OPENSSL_free(ctx->md_data);