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.
This commit is contained in:
Maxim Dounin 2017-07-11 16:06:26 +03:00
parent 92111c92e5
commit d289616b0f

View File

@ -355,7 +355,7 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx,
} }
if (suffix) { if (suffix) {
start = content_length - end; start = (end < content_length) ? content_length - end : 0;
end = content_length - 1; end = content_length - 1;
} }