]> git.kaiwu.me - nginx.git/commitdiff
Unsatisfiable range with start value greater than content length
authorIgor Sysoev <igor@sysoev.ru>
Tue, 30 Aug 2011 14:25:35 +0000 (14:25 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 30 Aug 2011 14:25:35 +0000 (14:25 +0000)
was not properly skipped. The bug has been introduced in r4057.

src/http/modules/ngx_http_range_filter_module.c

index 57a502536318e2494829f2c8d6695be931abe6ee..55a37d416d2cd1833259e2d97745579b4b5596ca 100644 (file)
@@ -264,10 +264,6 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx)
                 return NGX_HTTP_RANGE_NOT_SATISFIABLE;
             }
 
-            if (start >= content_length) {
-                goto skip;
-            }
-
             while (*p == ' ') { p++; }
 
             if (*p == ',' || *p == '\0') {
@@ -299,7 +295,7 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx)
             end = content_length - 1;
         }
 
-        if (start > end) {
+        if (start >= content_length || start > end) {
             goto skip;
         }