From 99bf1b56ece3acd8cc5a0811de8098c828b151c8 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Tue, 31 Mar 2015 17:45:50 +0300 Subject: Fixed invalid access to complex value defined as an empty string. Found by Valgrind. --- src/http/modules/ngx_http_headers_filter_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/http/modules') diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c index a10056903..a356814e4 100644 --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -378,7 +378,7 @@ ngx_http_parse_expires(ngx_str_t *value, ngx_http_expires_t *expires, } } - if (value->data[0] == '@') { + if (value->len && value->data[0] == '@') { value->data++; value->len--; minus = 0; @@ -390,12 +390,12 @@ ngx_http_parse_expires(ngx_str_t *value, ngx_http_expires_t *expires, *expires = NGX_HTTP_EXPIRES_DAILY; - } else if (value->data[0] == '+') { + } else if (value->len && value->data[0] == '+') { value->data++; value->len--; minus = 0; - } else if (value->data[0] == '-') { + } else if (value->len && value->data[0] == '-') { value->data++; value->len--; minus = 1; -- cgit