diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-07-17 21:50:47 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-07-17 21:50:47 -0400 |
commit | cac038a855700fb36f4078c34487e86d60e03682 (patch) | |
tree | e623f11a2f25d14d572ed82ab6e191a2f01f3ab4 /queue.cpp | |
parent | 20962b51a04ca04fa6a3209c2262afb795249871 (diff) | |
download | cryptopp-git-cac038a855700fb36f4078c34487e86d60e03682.tar.gz |
Cleared UBsan error using non-null pointer
Diffstat (limited to 'queue.cpp')
-rw-r--r-- | queue.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -41,6 +41,7 @@ public: inline size_t Put(const byte *begin, size_t length) { + if(!begin || !length) return length; size_t l = STDMIN(length, MaxSize()-m_tail); if (buf+m_tail != begin) memcpy(buf+m_tail, begin, l); @@ -59,6 +60,7 @@ public: inline size_t Peek(byte *target, size_t copyMax) const { + if(!target || !copyMax) return 0; size_t len = STDMIN(copyMax, m_tail-m_head); memcpy(target, buf+m_head, len); return len; |