提交 254f1c80 编写于 作者: J Jonas Maebe 提交者: Kurt Roeckx

get_cert_by_subject: check for NULL when allocating hent

Signed-off-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NDr. Stephen Henson <steve@openssl.org>
上级 fb7fbf28
......@@ -444,6 +444,13 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
if (!hent)
{
hent = OPENSSL_malloc(sizeof(BY_DIR_HASH));
if (hent == NULL)
{
CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
X509err(X509_F_GET_CERT_BY_SUBJECT,ERR_R_MALLOC_FAILURE);
ok = 0;
goto finish;
}
hent->hash = h;
hent->suffix = k;
if (!sk_BY_DIR_HASH_push(ent->hashes, hent))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册