diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2017-07-11 16:06:26 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2017-07-11 16:06:26 +0300 |
commit | d289616b0fb452f7dd4cbb4534c706950e3d6c24 (patch) | |
tree | b6a9bc4669d69910788823927183d2abf3f35c52 | |
parent | 92111c92e5860ff6338dc8ded8e3805189d02fc7 (diff) | |
download | nginx-d289616b0fb452f7dd4cbb4534c706950e3d6c24.tar.gz |
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.
-rw-r--r-- | src/http/modules/ngx_http_range_filter_module.c | 2 |
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; } |