summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-18 15:32:28 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-18 15:32:28 -0500
commit6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e (patch)
treef0d873d0b377a91dce5ee384e60426ef57efc92b /datatest.cpp
parentd2fda9bd4231a7dfcb44e59150f11246d992843f (diff)
downloadcryptopp-git-6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e.tar.gz
Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 (Coverity rollup)
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 2c838cfd..b4656541 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -23,6 +23,10 @@
# pragma strict_gs_check (on)
#endif
+#if defined(__COVERITY__)
+extern "C" void __coverity_tainted_data_sanitize__(void *);
+#endif
+
USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
@@ -579,7 +583,7 @@ void TestDigestOrMAC(TestData &v, bool testDigest)
{
int digestSize = -1;
if (test == "VerifyTruncated")
- pairs.GetIntValue(Name::DigestSize(), digestSize);
+ digestSize = pairs.GetIntValueWithDefault(Name::DigestSize(), digestSize);
HashVerificationFilter verifierFilter(*pHash, NULL, HashVerificationFilter::HASH_AT_BEGIN, digestSize);
PutDecodedDatumInto(v, digestName, verifierFilter);
PutDecodedDatumInto(v, "Message", verifierFilter);
@@ -628,6 +632,12 @@ bool GetField(std::istream &is, std::string &name, std::string &value)
{
name.resize(0); // GCC workaround: 2.95.3 doesn't have clear()
is >> name;
+
+#if defined(__COVERITY__)
+ // The datafile being read is in /usr/share, and it protected by filesystem ACLs
+ // __coverity_tainted_data_sanitize__(reinterpret_cast<void*>(&name));
+#endif
+
if (name.empty())
return false;