]> granicus.if.org Git - apache/commitdiff
* Adjust comment and don't get fooled by a negative end
authorRuediger Pluem <rpluem@apache.org>
Thu, 25 Aug 2011 14:31:36 +0000 (14:31 +0000)
committerRuediger Pluem <rpluem@apache.org>
Thu, 25 Aug 2011 14:31:36 +0000 (14:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1161576 13f79535-47bb-0310-9956-ffa450edef68

modules/http/byterange_filter.c

index 9a375dd067040f26b93e521dc17491e0ea02dc19..c6916441643705636802cb3a12af5415ae4ffefd 100644 (file)
@@ -154,15 +154,14 @@ static apr_status_t copy_brigade_range(apr_bucket_brigade *bb,
     apr_off_t pofft;
 
     /*
-     * We know that start and end are >= 0. See the comments in
-     * apr_brigade_partition why we should convert everything
-     * to apr_uint64_t. In short apr_off_t (for values >= 0)and apr_size_t
-     * fit into apr_uint64_t.
+     * Once we know that start and end are >= 0 convert everything to apr_uint64_t.
+     * See the comments in apr_brigade_partition why.
+     * In short apr_off_t (for values >= 0)and apr_size_t fit into apr_uint64_t.
      */
     start64 = (apr_uint64_t)start;
     end64 = (apr_uint64_t)end;
 
-    if (start < 0 || start64 > end64)
+    if (start < 0 || end < 0 || start64 > end64)
         return APR_EINVAL;
 
     for (e = APR_BRIGADE_FIRST(bb);