diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-07-06 15:57:08 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-07-06 15:57:08 -0400 |
commit | 2ffa70fbc65d6db23ad20ec9e6bd9975cd6a9b49 (patch) | |
tree | 25ee77413df25f0889d6b5c326702047c4b6d8e9 /cryptlib.cpp | |
parent | fd7115fc8bf0a396d36ae0d8e92473a09e9f2c2d (diff) | |
download | cryptopp-git-2ffa70fbc65d6db23ad20ec9e6bd9975cd6a9b49.tar.gz |
Clear asserts under DEBUG builds
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r-- | cryptlib.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp index c4463b0c..bf4577a9 100644 --- a/cryptlib.cpp +++ b/cryptlib.cpp @@ -405,8 +405,9 @@ RandomNumberGenerator & NullRNG() bool HashTransformation::TruncatedVerify(const byte *digest, size_t digestLength)
{
+ // Allocate at least 1 for calculated to avoid triggering diagnostics
ThrowIfInvalidTruncatedSize(digestLength);
- SecByteBlock calculated(digestLength);
+ SecByteBlock calculated(digestLength ? digestLength : 1);
TruncatedFinal(calculated, digestLength);
return VerifyBufsEqual(calculated, digest, digestLength);
}
|