From 9bb6680cfaedd3d46eff082ede8d0c76be6a2145 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 25 Apr 2024 01:33:44 -0400 Subject: [PATCH] Clear GCC overflow warning --- esign.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esign.cpp b/esign.cpp index 10f4e47b4..5bcbbe973 100644 --- a/esign.cpp +++ b/esign.cpp @@ -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());