httpd: emit correct content length on range requests past the end. Closes 4952
authorRob Walker <rwalker@codeaurora.org>
Tue, 3 Apr 2012 06:09:28 +0000 (08:09 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 3 Apr 2012 06:09:28 +0000 (08:09 +0200)
Signed-off-by: Rob Walker <rwalker@codeaurora.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/httpd.c

index f233cb0ba8035c095df213418f9b89dba0ff31f8..fb6ecbf70b24eeb2b03b02c1da2821fbe8681749 100644 (file)
@@ -1594,7 +1594,7 @@ static NOINLINE void send_file_and_exit(const char *url, int what)
        }
        range_len = MAXINT(off_t);
        if (range_start >= 0) {
-               if (!range_end) {
+               if (!range_end || range_end > file_size - 1) {
                        range_end = file_size - 1;
                }
                if (range_end < range_start