From 05ef5d5f5176ed7bcaf8c90e7fe0030349f8ce21 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Tue, 2 Jun 2020 21:53:47 +0400 Subject: [PATCH] Assertion in ByteRange allows 0-sized content The assertion in the ByteRange constructor was written under the assumption that the content must have non-zero size. Now it allows that corner case. --- src/server/byte_range.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/byte_range.cpp b/src/server/byte_range.cpp index e43faef1d..5378fda19 100644 --- a/src/server/byte_range.cpp +++ b/src/server/byte_range.cpp @@ -65,7 +65,7 @@ ByteRange::ByteRange(Kind kind, int64_t first, int64_t last) { assert(kind != NONE); assert(first >= 0); - assert(last >= first); + assert(last >= first || (first == 0 && last == -1)); } ByteRange::ByteRange(int64_t suffix_length)