summaryrefslogtreecommitdiff
path: root/src/http/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_headers_filter_module.c6
-rw-r--r--src/http/modules/ngx_http_proxy_module.c7
2 files changed, 7 insertions, 6 deletions
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;
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index d0b1c885d..00e8923a0 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1503,7 +1503,7 @@ ngx_http_proxy_body_output_filter(void *data, ngx_chain_t *in)
u_char *chunk;
ngx_int_t rc;
ngx_buf_t *b;
- ngx_chain_t *out, *cl, *tl, **ll;
+ ngx_chain_t *out, *cl, *tl, **ll, **fl;
ngx_http_proxy_ctx_t *ctx;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -1546,6 +1546,7 @@ ngx_http_proxy_body_output_filter(void *data, ngx_chain_t *in)
size = 0;
cl = in;
+ fl = ll;
for ( ;; ) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -1602,8 +1603,8 @@ ngx_http_proxy_body_output_filter(void *data, ngx_chain_t *in)
b->pos = chunk;
b->last = ngx_sprintf(chunk, "%xO" CRLF, size);
- tl->next = out;
- out = tl;
+ tl->next = *fl;
+ *fl = tl;
}
if (cl->buf->last_buf) {