crypto: change assertion to condition in bio

Read head can be the same as write head, even if there's some data to
read.
This commit is contained in:
Fedor Indutny 2013-06-19 10:16:59 +02:00
parent 7373c4ddb7
commit bf8dc0762a

View File

@ -209,8 +209,7 @@ size_t NodeBIO::Read(char* out, size_t size) {
read_head_->write_pos_ = 0;
// But not get beyond write_head_
if (length_ != bytes_read) {
assert(read_head_ != write_head_);
if (length_ != bytes_read && read_head_ != write_head_) {
read_head_ = read_head_->next_;
}
}