Fix potential out-of-bounds access

This commit is contained in:
Chocobo1 2021-02-09 12:53:37 +08:00 committed by sledgehammer999
parent 7696895a88
commit 2c5271b3b2
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -87,7 +87,7 @@ namespace
int i = 0; int i = 0;
val = static_cast<qreal>(sizeInBytes); 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.; val /= 1024.;
++i; ++i;