diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-06-11 12:49:03 +0200 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-06-14 17:10:04 +0200 |
commit | 56d9c48573e4bfe98021fc0c678e20b90538c976 (patch) | |
tree | 3c95c2dcdf000aa525e4aba294b247c7a106162d /src/node_crypto_bio.h | |
parent | e92f4879eb6c21d66ceaa819ae8f045226b74a3e (diff) | |
download | node-new-56d9c48573e4bfe98021fc0c678e20b90538c976.tar.gz |
crypto: fix excessive buffer allocation
Allocate buffer only if the next one isn't free.
Diffstat (limited to 'src/node_crypto_bio.h')
-rw-r--r-- | src/node_crypto_bio.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index e565b7fc93..c2fd6a0ba7 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -59,6 +59,9 @@ class NodeBIO { ~NodeBIO(); + // Allocate new buffer for write if needed + void TryAllocateForWrite(); + // Read `len` bytes maximum into `out`, return actual number of read bytes size_t Read(char* out, size_t size); |