From 2ffa70fbc65d6db23ad20ec9e6bd9975cd6a9b49 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 6 Jul 2019 15:57:08 -0400 Subject: Clear asserts under DEBUG builds --- cryptlib.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cryptlib.cpp') 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); } -- cgit v1.2.1