summaryrefslogtreecommitdiff
path: root/authenc.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-01-30 09:56:36 -0500
committerJeffrey Walton <noloader@gmail.com>2019-01-30 09:56:36 -0500
commit33897e944c40261783c9e800636602db52d88ccb (patch)
tree8f9c9f7db24f554a8b2951451bd13ffc2e54c76e /authenc.cpp
parent02f5da3511c94041ccd4564e14b996091ca45d84 (diff)
downloadcryptopp-git-33897e944c40261783c9e800636602db52d88ccb.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.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/authenc.cpp b/authenc.cpp
index 040a8063..bd7e3994 100644
--- a/authenc.cpp
+++ b/authenc.cpp
@@ -18,10 +18,6 @@ void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_
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)
@@ -49,7 +45,8 @@ void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_
len = leftOver;
}
- memcpy(data, input, len);
+ if (data)
+ memcpy(data, input, len);
num = (unsigned int)len;
}