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.
This commit is contained in:
parent
8c8ebe49b6
commit
ba0f7b8066
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user