diff --git a/ssl/tls1.c b/ssl/tls1.c index e95d5eb18..800decbaa 100755 --- a/ssl/tls1.c +++ b/ssl/tls1.c @@ -342,7 +342,7 @@ int add_cert(SSL_CTX *ssl_ctx, const uint8_t *buf, int len) X509_CTX *cert = NULL; int offset; - while (ssl_ctx->certs[i].buf && i < CONFIG_SSL_MAX_CERTS) + while (i < CONFIG_SSL_MAX_CERTS && ssl_ctx->certs[i].buf) i++; if (i == CONFIG_SSL_MAX_CERTS) /* too many certs */