From e1a7db8fdd2f91367d1ef3253424701c138927c6 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 11 Apr 2012 16:01:20 +0000 Subject: [PATCH] use different variable for chain iteration --- ssl/ssl_cert.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index a2682daaed..222f703284 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -321,15 +321,16 @@ CERT *ssl_cert_dup(CERT *cert) if (cpk->chain) { + int j; rpk->chain = sk_X509_dup(cpk->chain); if (!rpk->chain) { SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE); goto err; } - for (i = 0; i < sk_X509_num(rpk->chain); i++) + for (j = 0; j < sk_X509_num(rpk->chain); j++) { - X509 *x = sk_X509_value(rpk->chain, i); + X509 *x = sk_X509_value(rpk->chain, j); CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); } } -- 2.40.0