mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-14 10:29:42 +00:00
Fix the error handling in CRYPTO_dup_ex_data.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2998)
This commit is contained in:
parent
144ab9b27f
commit
62f488d317
@ -459,7 +459,7 @@ static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
|||||||
CRYPTO_EX_DATA *from)
|
CRYPTO_EX_DATA *from)
|
||||||
{
|
{
|
||||||
int mx, j, i;
|
int mx, j, i;
|
||||||
char *ptr;
|
void *ptr;
|
||||||
CRYPTO_EX_DATA_FUNCS **storage = NULL;
|
CRYPTO_EX_DATA_FUNCS **storage = NULL;
|
||||||
EX_CLASS_ITEM *item;
|
EX_CLASS_ITEM *item;
|
||||||
if (!from->sk)
|
if (!from->sk)
|
||||||
@ -473,6 +473,8 @@ static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
|||||||
if (j < mx)
|
if (j < mx)
|
||||||
mx = j;
|
mx = j;
|
||||||
if (mx > 0) {
|
if (mx > 0) {
|
||||||
|
if (!CRYPTO_set_ex_data(to, mx - 1, NULL))
|
||||||
|
goto skip;
|
||||||
storage = OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS *));
|
storage = OPENSSL_malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS *));
|
||||||
if (!storage)
|
if (!storage)
|
||||||
goto skip;
|
goto skip;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user