Mercurial > hg > nginx
comparison src/http/modules/ngx_http_range_filter_module.c @ 7055:887c8c58ffeb
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 11 Jul 2017 16:06:26 +0300 |
parents | e02555553d0b |
children | e3723f2a11b7 |
comparison
equal
deleted
inserted
replaced
7054:e02555553d0b | 7055:887c8c58ffeb |
---|---|
353 if (*p != ',' && *p != '\0') { | 353 if (*p != ',' && *p != '\0') { |
354 return NGX_HTTP_RANGE_NOT_SATISFIABLE; | 354 return NGX_HTTP_RANGE_NOT_SATISFIABLE; |
355 } | 355 } |
356 | 356 |
357 if (suffix) { | 357 if (suffix) { |
358 start = content_length - end; | 358 start = (end < content_length) ? content_length - end : 0; |
359 end = content_length - 1; | 359 end = content_length - 1; |
360 } | 360 } |
361 | 361 |
362 if (end >= content_length) { | 362 if (end >= content_length) { |
363 end = content_length; | 363 end = content_length; |