summaryrefslogtreecommitdiff
path: root/crypto/asn1/x_x509.c
diff options
context:
space:
mode:
authorgeoff <geoff>2001-08-12 16:51:50 +0000
committergeoff <geoff>2001-08-12 16:51:50 +0000
commitf295056550684f3410c22859fa201c7f61175fc8 (patch)
treeb3b2eb31e3d4bf93b1ba3d3016eb6b620ebae011 /crypto/asn1/x_x509.c
parentafbf21b175195c392fe7041e109670b910cfad79 (diff)
downloadopenssl-f295056550684f3410c22859fa201c7f61175fc8.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.
Diffstat (limited to 'crypto/asn1/x_x509.c')
-rw-r--r--crypto/asn1/x_x509.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c
index 6a2adfc65..b0d859d38 100644
--- a/crypto/asn1/x_x509.c
+++ b/crypto/asn1/x_x509.c
@@ -142,9 +142,10 @@ ASN1_METHOD *X509_asn1_meth(void)
int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- x509_meth_num++;
- return(CRYPTO_get_ex_new_index(x509_meth_num-1,
- &x509_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(x509_meth_num, &x509_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (x509_meth_num++);
}
int X509_set_ex_data(X509 *r, int idx, void *arg)