From: Dr. Stephen Henson Date: Wed, 11 Apr 2012 16:01:20 +0000 (+0000) Subject: use different variable for chain iteration X-Git-Tag: OpenSSL_1_0_2-beta1~666 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1a7db8fdd2f91367d1ef3253424701c138927c6;p=openssl use different variable for chain iteration --- 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); } }