Skip to content

Commit

Permalink
Clear GCC overflow warning
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Apr 25, 2024
1 parent c2bd7ef commit 9bb6680
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions esign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 9bb6680

Please sign in to comment.