diff options
author | Geoff Thorpe <geoff@openssl.org> | 2001-08-12 18:52:00 +0200 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2001-08-12 18:52:00 +0200 |
commit | b7727ee616a3351a001497dda077ec63330861db (patch) | |
tree | cfb5ada448b2a405e2b7b3967a48ba61f690d9aa /crypto/dsa | |
parent | Move CIPHER_CTX cleanups to _Final routines instead of _Init, which avoids (diff) | |
download | openssl-b7727ee616a3351a001497dda077ec63330861db.tar.xz openssl-b7727ee616a3351a001497dda077ec63330861db.zip |
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.
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_lib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 607f84e45b..5855568741 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -250,9 +250,10 @@ int DSA_size(const DSA *r) int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) { - dsa_meth_num++; - return(CRYPTO_get_ex_new_index(dsa_meth_num-1, - &dsa_meth,argl,argp,new_func,dup_func,free_func)); + if(CRYPTO_get_ex_new_index(dsa_meth_num, &dsa_meth, argl, argp, + new_func, dup_func, free_func) < 0) + return -1; + return (dsa_meth_num++); } int DSA_set_ex_data(DSA *d, int idx, void *arg) |