1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Fix potential out-of-bounds access

This commit is contained in:
Chocobo1 2021-02-09 12:53:37 +08:00
parent c8e8a44747
commit fffe5e7003
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -87,7 +87,7 @@ namespace
int i = 0;
val = static_cast<qreal>(sizeInBytes);
while ((val >= 1024.) && (i <= static_cast<int>(Utils::Misc::SizeUnit::ExbiByte)))
while ((val >= 1024.) && (i < static_cast<int>(Utils::Misc::SizeUnit::ExbiByte)))
{
val /= 1024.;
++i;