mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
Added additional bound checks.
This commit is contained in:
@@ -61,7 +61,7 @@ RNG_SFMT::RNG_SFMT(QObject *parent)
|
||||
unsigned int RNG_SFMT::getNumber(unsigned int min, unsigned int max)
|
||||
{
|
||||
// This all makes no sense if min > max, which should never happen.
|
||||
if(min > max) {
|
||||
if(min > max || max >= UINT_MAX || min >= UINT_MAX) {
|
||||
throw std::invalid_argument(
|
||||
QString("Invalid bounds for RNG: min > max! Values were: min = " +
|
||||
QString::number(min) + ", max = " +
|
||||
|
||||
Reference in New Issue
Block a user