use different variable for chain iteration
authorDr. Stephen Henson <steve@openssl.org>
Wed, 11 Apr 2012 16:01:08 +0000 (16:01 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 11 Apr 2012 16:01:08 +0000 (16:01 +0000)
ssl/ssl_cert.c

index a2682da..222f703 100644 (file)
@@ -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);
                                }
                        }