check both sides of range for invalid byte range

This commit is contained in:
Stephen Birarda 2017-04-17 19:14:24 -07:00 committed by Atlante45
parent 397a29039e
commit 8145e416f9

View file

@ -74,7 +74,7 @@ void SendAssetTask::run() {
byteRange.toExclusive = file.size(); byteRange.toExclusive = file.size();
} }
if (file.size() < std::abs(byteRange.toExclusive)) { if (file.size() < std::abs(byteRange.fromInclusive) || file.size() < byteRange.toExclusive) {
replyPacketList->writePrimitive(AssetServerError::InvalidByteRange); replyPacketList->writePrimitive(AssetServerError::InvalidByteRange);
qCDebug(networking) << "Bad byte range: " << hexHash << " " qCDebug(networking) << "Bad byte range: " << hexHash << " "
<< byteRange.fromInclusive << ":" << byteRange.toExclusive; << byteRange.fromInclusive << ":" << byteRange.toExclusive;