Clear GCC overflow warning

This commit is contained in:
Jeffrey Walton 2024-04-25 01:33:44 -04:00
parent c2bd7efb49
commit 9bb6680cfa
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -111,6 +111,9 @@ void InvertibleESIGNFunction::GenerateRandom(RandomNumberGenerator &rng, const N
if (param.GetValue("Seed", seedParam))
{
if (seedParam.size() > seed.ELEMS_MAX - 4)
throw InvalidArgument("InvertibleESIGNFunction::GenerateRandom: buffer overflow");
seed.resize(seedParam.size() + 4);
std::memcpy(seed + 4, seedParam.begin(), seedParam.size());