Cleared Coverity finding CID 12086 (Issue 299)

pull/301/head
Jeffrey Walton 2016-09-22 03:08:28 -04:00
parent 17258a49d3
commit d5aff4e4f8
1 changed files with 5 additions and 0 deletions

View File

@ -431,6 +431,11 @@ void FIPS140_GenerateRandomFiles()
template <class T, bool NON_NEGATIVE>
T StringToValue(const std::string& str) {
std::istringstream iss(str);
// Arbitrary, but we need to clear a Coverity finding TAINTED_SCALAR
if(iss.str().length() > 25)
throw InvalidArgument("cryptest.exe: '" + str +"' is tool ong");
T value;
iss >> std::noskipws >> value;