]> git.kaiwu.me - nginx.git/commitdiff
fix memory corruption in $ssl_client_cert
authorIgor Sysoev <igor@sysoev.ru>
Mon, 27 Jul 2009 11:51:12 +0000 (11:51 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 27 Jul 2009 11:51:12 +0000 (11:51 +0000)
src/event/ngx_event_openssl.c

index 34d95385f369c2c53cb315922f803fc8f119a706..846114077f211de89e9f31134dc82944de5337cd 100644 (file)
@@ -2011,7 +2011,7 @@ ngx_ssl_get_certificate(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
 
     p = s->data;
 
-    for (i = 0; i < len; i++) {
+    for (i = 0; i < cert.len - 1; i++) {
         *p++ = cert.data[i];
         if (cert.data[i] == LF) {
             *p++ = '\t';