summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2017-07-11 16:06:26 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2017-07-11 16:06:26 +0300
commitd289616b0fb452f7dd4cbb4534c706950e3d6c24 (patch)
treeb6a9bc4669d69910788823927183d2abf3f35c52
parent92111c92e5860ff6338dc8ded8e3805189d02fc7 (diff)
downloadnginx-d289616b0fb452f7dd4cbb4534c706950e3d6c24.tar.gz
nginx-d289616b0fb452f7dd4cbb4534c706950e3d6c24.tar.bz2
Range filter: avoid negative range start.
Suffix ranges no longer allowed to set negative start values, to prevent ranges with negative start from appearing even if total size protection will be removed.
Diffstat (limited to '')
-rw-r--r--src/http/modules/ngx_http_range_filter_module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c
index ac910fdfe..292a2b863 100644
--- a/src/http/modules/ngx_http_range_filter_module.c
+++ b/src/http/modules/ngx_http_range_filter_module.c
@@ -355,7 +355,7 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx,
}
if (suffix) {
- start = content_length - end;
+ start = (end < content_length) ? content_length - end : 0;
end = content_length - 1;
}