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

index a2682daaedd951321a57ccc8e0e1bf8b387ca6dc..222f703284355ba821c09a32f2bd07d960e239c2 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);
                                }
                        }