Commit 596a29af authored by Paweł Wegner's avatar Paweł Wegner
Browse files

MegaNz: fixed range check.

parent c27cd8b4
......@@ -322,7 +322,8 @@ IHttpServer::IResponse::Pointer MegaNz::HttpServerCallback::receivedConnection(
if (const char* range_str = connection->header("Range")) {
range = util::parse_range(range_str);
if (range.size == -1) range.size = node->getSize() - range.start;
if (range.start + range.size > node->getSize() || range.start == -1)
if (range.start + range.size > node->getSize() || range.start == -1 ||
range.size < 0)
return server.createResponse(IHttpRequest::RangeInvalid, {},
"invalid range");
std::stringstream stream;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment