summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-09-11 03:17:44 -0400
committerJeffrey Walton <noloader@gmail.com>2020-09-11 03:17:44 -0400
commit04dee2a46735029ea48c8bd7c3e097bc8045859d (patch)
tree8fe6ba8ab90c6441148a0b819bd64292a66cc260 /cryptlib.cpp
parente16be7a380edba5b0aefaaccaf1717112e8652af (diff)
downloadcryptopp-git-04dee2a46735029ea48c8bd7c3e097bc8045859d.tar.gz
Fix bad allocation size due to BufferedTransformation::TransferMessagesTo2 (GH #962)
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r--cryptlib.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp
index 929ed618..06a35079 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -647,7 +647,7 @@ size_t BufferedTransformation::TransferMessagesTo2(BufferedTransformation &targe
while (AnyRetrievable())
{
- transferredBytes = LWORD_MAX;
+ transferredBytes = (std::min)(LWORD_MAX, MaxRetrievable());
blockedBytes = TransferTo2(target, transferredBytes, channel, blocking);
if (blockedBytes > 0)
return blockedBytes;