diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-01-30 07:28:08 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-01-30 07:28:08 -0500 |
commit | 02f5da3511c94041ccd4564e14b996091ca45d84 (patch) | |
tree | 581682cd43f82974d0a5c5764a3e0bc4db513d11 /authenc.cpp | |
parent | b69bfb5bdf0239e7ac7f38f7f369e7bc8ff5b836 (diff) | |
download | cryptopp-git-02f5da3511c94041ccd4564e14b996091ca45d84.tar.gz |
Clear UBsan finding with -std=c++03
New finding after cutting in ChaCha20/Poly1305
Diffstat (limited to 'authenc.cpp')
-rw-r--r-- | authenc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/authenc.cpp b/authenc.cpp index bb6cf2c0..040a8063 100644 --- a/authenc.cpp +++ b/authenc.cpp @@ -10,10 +10,18 @@ NAMESPACE_BEGIN(CryptoPP) void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_t len)
{
+ // UBsan finding with -std=c++03 using memcpy
+ CRYPTOPP_ASSERT(input && len);
+ if(!input || !len) return;
+
unsigned int blockSize = AuthenticationBlockSize();
unsigned int &num = m_bufferedDataLength;
byte* data = m_buffer.begin();
+ // UBsan finding with -std=c++03 using memcpy
+ CRYPTOPP_ASSERT(data);
+ if(!data) return;
+
if (num != 0) // process left over data
{
if (num+len >= blockSize)
|