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-08 15:51:55 +0400 |
commit | ba0f7b8066cb4dc8cb3cd4931e52aa94af40a709 (patch) | |
tree | 552f7f8a6afbcc13d4b51b901ae33f84a5b50066 /src | |
parent | 8c8ebe49b62c47b0ac87d697d0bc3515604667c3 (diff) | |
download | node-ba0f7b8066cb4dc8cb3cd4931e52aa94af40a709.tar.gz |
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')
-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 d17ee21e7..d69eeb8f9 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; |