diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-01-30 10:00:09 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-01-30 10:00:09 -0500 |
commit | 97838012eeb77fab96bee12822b2ed46d3af8d80 (patch) | |
tree | 4658785010439011a4b380bb880448f347e9965f /authenc.cpp | |
parent | 33897e944c40261783c9e800636602db52d88ccb (diff) | |
download | cryptopp-git-97838012eeb77fab96bee12822b2ed46d3af8d80.tar.gz |
Add test for length in memcpy
Diffstat (limited to 'authenc.cpp')
-rw-r--r-- | authenc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/authenc.cpp b/authenc.cpp index bd7e3994..a455f02c 100644 --- a/authenc.cpp +++ b/authenc.cpp @@ -18,7 +18,7 @@ void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_ unsigned int &num = m_bufferedDataLength;
byte* data = m_buffer.begin();
- if (num != 0) // process left over data
+ if (data && num) // process left over data
{
if (num+len >= blockSize)
{
@@ -45,7 +45,7 @@ void AuthenticatedSymmetricCipherBase::AuthenticateData(const byte *input, size_ len = leftOver;
}
- if (data)
+ if (data && len)
memcpy(data, input, len);
num = (unsigned int)len;
}
|