comparison src/http/modules/ngx_http_proxy_module.c @ 648:fa9b9e42035e NGINX_1_0_14

nginx 1.0.14 *) Security: content of previously freed memory might be sent to a client if backend returned specially crafted response. Thanks to Matthew Daley.
author Igor Sysoev <http://sysoev.ru>
date Thu, 15 Mar 2012 00:00:00 +0400
parents 09a689c5e494
children
comparison
equal deleted inserted replaced
647:db509e2f8037 648:fa9b9e42035e
1276 } 1276 }
1277 1277
1278 h->value.data = h->key.data + h->key.len + 1; 1278 h->value.data = h->key.data + h->key.len + 1;
1279 h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1; 1279 h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
1280 1280
1281 ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1); 1281 ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
1282 ngx_cpystrn(h->value.data, r->header_start, h->value.len + 1); 1282 h->key.data[h->key.len] = '\0';
1283 ngx_memcpy(h->value.data, r->header_start, h->value.len);
1284 h->value.data[h->value.len] = '\0';
1283 1285
1284 if (h->key.len == r->lowcase_index) { 1286 if (h->key.len == r->lowcase_index) {
1285 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len); 1287 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
1286 1288
1287 } else { 1289 } else {