summaryrefslogtreecommitdiff
path: root/src/node_crypto_bio.h
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-06-11 12:49:03 +0200
committerFedor Indutny <fedor.indutny@gmail.com>2013-06-14 17:10:04 +0200
commit56d9c48573e4bfe98021fc0c678e20b90538c976 (patch)
tree3c95c2dcdf000aa525e4aba294b247c7a106162d /src/node_crypto_bio.h
parente92f4879eb6c21d66ceaa819ae8f045226b74a3e (diff)
downloadandroid-node-v8-56d9c48573e4bfe98021fc0c678e20b90538c976.tar.gz
android-node-v8-56d9c48573e4bfe98021fc0c678e20b90538c976.tar.bz2
android-node-v8-56d9c48573e4bfe98021fc0c678e20b90538c976.zip
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.h3
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);