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

dev_crypto_cipher: return immediately if allocating cin/cout failed

Signed-off-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 c84029db
......@@ -193,6 +193,8 @@ static int dev_crypto_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out,
if(((unsigned long)in&3) || cinl != inl)
{
cin=OPENSSL_malloc(cinl);
if (cin == NULL)
return 0;
memcpy(cin,in,inl);
cryp.src=cin;
}
......@@ -200,6 +202,12 @@ static int dev_crypto_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out,
if(((unsigned long)out&3) || cinl != inl)
{
cout=OPENSSL_malloc(cinl);
if (cout == NULL)
{
if (cin != NULL)
OPENSSL_free(cin);
return 0;
}
cryp.dst=cout;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册