summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-09-12 09:31:02 -0400
committerJeffrey Walton <noloader@gmail.com>2020-09-12 09:31:02 -0400
commit21992b9403f3d73fb44ce1ba51191f36fcae6091 (patch)
treec7405116dcf69f04102d62792cba27bc760ea0d3 /cryptlib.cpp
parent6c1f0e4727c7357a948e525b1736cad53936466e (diff)
downloadcryptopp-git-21992b9403f3d73fb44ce1ba51191f36fcae6091.tar.gz
Update comments
Diffstat (limited to 'cryptlib.cpp')
-rw-r--r--cryptlib.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/cryptlib.cpp b/cryptlib.cpp
index 06a35079..a7523497 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -647,7 +647,12 @@ size_t BufferedTransformation::TransferMessagesTo2(BufferedTransformation &targe
while (AnyRetrievable())
{
- transferredBytes = (std::min)(LWORD_MAX, MaxRetrievable());
+ // MaxRetrievable() instead of LWORD_MAX due to GH #962. If
+ // the target calls CreatePutSpace(), then the allocation
+ // size will be LWORD_MAX. That happens when target is a
+ // ByteQueue. Maybe ByteQueue should check the size, and if
+ // it is LWORD_MAX or -1, then use a default like 4096.
+ transferredBytes = MaxRetrievable();
blockedBytes = TransferTo2(target, transferredBytes, channel, blocking);
if (blockedBytes > 0)
return blockedBytes;