From 29e7d3554dbe28266f3a2a64efdd406d6262a59e Mon Sep 17 00:00:00 2001 From: olereinhardt Date: Wed, 24 Sep 2014 10:21:23 +0000 Subject: [PATCH] Fixed array access out of bounds bug in add_cert() git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@234 9a5d90b5-6617-0410-8a86-bb477d3ed2e3 --- ssl/tls1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */