aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2001-08-12 17:14:35 +0000
committerGeoff Thorpe <geoff@openssl.org>2001-08-12 17:14:35 +0000
commit6982c0da4e73063202cd09b08a654db9bce25ef2 (patch)
tree3c7f3b5888243c24ce51e73f23ee89146609929a
parentb7727ee616a3351a001497dda077ec63330861db (diff)
downloadopenssl-6982c0da4e73063202cd09b08a654db9bce25ef2.tar.gz
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.
-rw-r--r--crypto/engine/engine_list.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/engine/engine_list.c b/crypto/engine/engine_list.c
index 0f1ea991c8..087a0df15b 100644
--- a/crypto/engine/engine_list.c
+++ b/crypto/engine/engine_list.c
@@ -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,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- engine_ex_data_num++;
- return(CRYPTO_get_ex_new_index(engine_ex_data_num - 1,
- &engine_ex_data_stack, argl, argp,
- new_func, dup_func, free_func));
+ if(CRYPTO_get_ex_new_index(engine_ex_data_num, &engine_ex_data_stack,
+ argl, argp, new_func, dup_func, free_func) < 0)
+ return -1;
+ return (engine_ex_data_num++);
}
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg)