summaryrefslogtreecommitdiff
path: root/test.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-09-22 03:08:28 -0400
committerJeffrey Walton <noloader@gmail.com>2016-09-22 03:08:28 -0400
commitd5aff4e4f86ddd8e27db8a6f27670ca3ededc01b (patch)
treef85a59184fa64eefffe280695f63ce9f4fb9a6c5 /test.cpp
parent17258a49d3183612b000d60c560836b001386b46 (diff)
downloadcryptopp-git-d5aff4e4f86ddd8e27db8a6f27670ca3ededc01b.tar.gz
Cleared Coverity finding CID 12086 (Issue 299)
Diffstat (limited to 'test.cpp')
-rw-r--r--test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test.cpp b/test.cpp
index a7cdfcd5..b8f69343 100644
--- a/test.cpp
+++ b/test.cpp
@@ -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;