The indexes returned by ***_get_ex_new_index() functions are used when
setting stack (actually, array) values in ex_data. So only increment the global counters if the underlying CRYPTO_get_ex_new_index() call succeeds. This change doesn't make "ex_data" right (see the comment at the head of ex_data.c to know why), but at least makes the source code marginally less frustrating.
This commit is contained in:
parent
b7727ee616
commit
6982c0da4e
@ -451,10 +451,10 @@ static int ENGINE_free_nolock(ENGINE *e)
|
|||||||
int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
|
int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
|
||||||
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
|
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
|
||||||
{
|
{
|
||||||
engine_ex_data_num++;
|
if(CRYPTO_get_ex_new_index(engine_ex_data_num, &engine_ex_data_stack,
|
||||||
return(CRYPTO_get_ex_new_index(engine_ex_data_num - 1,
|
argl, argp, new_func, dup_func, free_func) < 0)
|
||||||
&engine_ex_data_stack, argl, argp,
|
return -1;
|
||||||
new_func, dup_func, free_func));
|
return (engine_ex_data_num++);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg)
|
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user