diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-04-06 23:26:00 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-04-10 16:55:10 +0400 |
commit | 798d1772c09c718b6c9d350dd03d0461155c725a (patch) | |
tree | b7089180e2308fafb80a426a88c18d748ba163f2 /src/node_crypto_bio.cc | |
parent | 62a214268ae39aea394ce46cb8eb53d0bdb15f99 (diff) | |
download | android-node-v8-798d1772c09c718b6c9d350dd03d0461155c725a.tar.gz android-node-v8-798d1772c09c718b6c9d350dd03d0461155c725a.tar.bz2 android-node-v8-798d1772c09c718b6c9d350dd03d0461155c725a.zip |
crypto: fix changing buffers in bio
We should go to next buffer if *current* one is full, not the next one.
Otherwise we may hop through buffers and written data will become
interleaved, which will lead to failure.
Diffstat (limited to 'src/node_crypto_bio.cc')
-rw-r--r-- | src/node_crypto_bio.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index d17ee21e78..d69eeb8f9b 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -279,7 +279,7 @@ void NodeBIO::Write(const char* data, size_t size) { // Go to next buffer if there still are some bytes to write if (left != 0) { - if (write_head_->next_->write_pos_ == kBufferLength) { + if (write_head_->write_pos_ == kBufferLength) { Buffer* next = new Buffer(); next->next_ = write_head_->next_; write_head_->next_ = next; |