mirror of
https://github.com/openssl/openssl.git
synced 2024-12-15 21:13:38 +08:00
Check that OPENSSL_malloc() really returned some memory.
PR: 751 Notified by: meder@mcs.anl.gov Reviewed by: Lutz Jaenicke, Richard Levitte
This commit is contained in:
parent
6781efb92f
commit
1145e03870
@ -149,6 +149,11 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp
|
|||||||
|
|
||||||
ctx->cipher=cipher;
|
ctx->cipher=cipher;
|
||||||
ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size);
|
ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size);
|
||||||
|
if (!ctx->cipher_data)
|
||||||
|
{
|
||||||
|
EVPerr(EVP_F_EVP_CIPHERINIT, ERR_R_MALLOC_FAILURE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
ctx->key_len = cipher->key_len;
|
ctx->key_len = cipher->key_len;
|
||||||
ctx->flags = 0;
|
ctx->flags = 0;
|
||||||
if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT)
|
if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT)
|
||||||
|
Loading…
Reference in New Issue
Block a user